From: Eric Christopher Date: Mon, 7 Nov 2011 22:11:16 +0000 (+0000) Subject: Add all completed and named types to the dwarf type accelerator tables. X-Git-Tag: android-x86-6.0-r1~400 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8b2139f5e988cd975f74dec8238aa74541a7658d;p=android-x86%2Fexternal-llvm.git Add all completed and named types to the dwarf type accelerator tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144027 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index cb80bd810e3..660992a2945 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -634,6 +634,12 @@ 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. diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 39d0d1c96bb..64e0e92edb5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1834,8 +1834,7 @@ void DwarfDebug::emitAccelTypes() { for (DenseMap::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) { CompileUnit *TheCU = I->second; - const StringMap &Names = TheCU->getGlobalTypes(); - //TODO: TheCU->getAccelTypes(); + const StringMap &Names = TheCU->getAccelTypes(); for (StringMap::const_iterator GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) { const char *Name = GI->getKeyData();