Debug Info: instead of calling addToContextOwner which constructs the context
authorManman Ren <manman.ren@gmail.com>
Tue, 29 Oct 2013 22:49:29 +0000 (22:49 +0000)
committerManman Ren <manman.ren@gmail.com>
Tue, 29 Oct 2013 22:49:29 +0000 (22:49 +0000)
commitd498e5e960f237d3eb04ad7680bd093d1954c7fe
treee102ff8da43f1f3510c12177713e49505d49fd56
parentd1ea5928ddbd38e99507f7f18df8ec8a865c7799
Debug Info: instead of calling addToContextOwner which constructs the context
after the DIE creation, we construct the context first.

Ensure that we create the context before we create a type so that we can add
the newly created type to the parent. Remove last use of addToContextOwner
now that it's not needed.

We use createAndAddDIE to wrap around "new DIE(". Now all shareable DIEs
should be added to their parents right after the creation.

Reviewed off-list by Eric, Thanks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193657 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
test/DebugInfo/X86/DW_AT_byte_size.ll
test/DebugInfo/X86/debug-info-blocks.ll
test/DebugInfo/X86/empty-and-one-elem-array.ll
test/DebugInfo/X86/empty-array.ll
test/DebugInfo/X86/gnu-public-names.ll
test/DebugInfo/X86/nondefault-subrange-array.ll
test/DebugInfo/X86/subrange-type.ll
test/DebugInfo/member-pointers.ll
test/DebugInfo/tu-member-pointer.ll