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.

llvm-svn: 144306
This commit is contained in:
Eric Christopher 2011-11-10 19:52:58 +00:00
parent 638095fa8f
commit e288793e44
1 changed files with 5 additions and 7 deletions

View File

@ -605,7 +605,11 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
assert(Ty.isDerivedType() && "Unknown kind of DIType"); assert(Ty.isDerivedType() && "Unknown kind of DIType");
constructTypeDIE(*TyDIE, DIDerivedType(Ty)); 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()); addToContextOwner(TyDIE, Ty.getContext());
return TyDIE; 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 // If this is a complete composite type then include it in the
// list of global types. // list of global types.
addGlobalType(Ty); 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. /// addGlobalType - Add a new global type to the compile unit.