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)
commitf4c339e04a33c85a40c8d0df692614f6d8f56a6a
treea7e029927e1cb59d45d20bb3269f59fa9f5f4416
parentb504f49448deef18c6c4bd245b8f2a7f5fd81eb9
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.

llvm-svn: 193657
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/test/DebugInfo/X86/DW_AT_byte_size.ll
llvm/test/DebugInfo/X86/debug-info-blocks.ll
llvm/test/DebugInfo/X86/empty-and-one-elem-array.ll
llvm/test/DebugInfo/X86/empty-array.ll
llvm/test/DebugInfo/X86/gnu-public-names.ll
llvm/test/DebugInfo/X86/nondefault-subrange-array.ll
llvm/test/DebugInfo/X86/subrange-type.ll
llvm/test/DebugInfo/member-pointers.ll
llvm/test/DebugInfo/tu-member-pointer.ll