diff options
author | Eric Christopher <echristo@apple.com> | 2011-11-10 19:52:58 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-11-10 19:52:58 +0000 |
commit | 1b3f9198ab3880be34b6252423b9e388b5cd6a5e (patch) | |
tree | 1f70dd02e9c4148e6d406c42c9fffa7619bcc21c /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 0ffe2b4dd6f26fa19827f85bf9e4a766539a859c (diff) |
Move type handling to make sure we get all created types that aren't
forward decls and have names into the dwarf accelerator types table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index a68da04907..d440a74619 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -605,7 +605,11 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) { assert(Ty.isDerivedType() && "Unknown kind of DIType"); constructTypeDIE(*TyDIE, DIDerivedType(Ty)); } - + // If this is a named finished type then include it in the list of types + // for the accelerator tables. + if (!Ty.getName().empty() && !Ty.isForwardDecl()) + addAccelType(Ty.getName(), TyDIE); + addToContextOwner(TyDIE, Ty.getContext()); return TyDIE; } @@ -634,12 +638,6 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) { // If this is a complete composite type then include it in the // list of global types. addGlobalType(Ty); - - // If this is a named finished type then include it in the list of types - // for the accelerator tables. - if (!Ty.getName().empty() && !Ty.isForwardDecl()) - if (DIEEntry *Entry = getDIEEntry(Ty)) - AccelTypes[Ty.getName()] = Entry->getEntry(); } /// addGlobalType - Add a new global type to the compile unit. |