Add all completed and named types to the dwarf type accelerator tables.
authorEric Christopher <echristo@apple.com>
Mon, 7 Nov 2011 22:11:16 +0000 (22:11 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 7 Nov 2011 22:11:16 +0000 (22:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144027 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index cb80bd810e3baa0e0b994788e293d1ae37f1affb..660992a2945793dd5a50076f7da33ad677abe45e 100644 (file)
@@ -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.
index 39d0d1c96bbb0416aab994e8deb8b8f4bff0c975..64e0e92edb56a4ec410f4aa38c1d38352eafba77 100644 (file)
@@ -1834,8 +1834,7 @@ void DwarfDebug::emitAccelTypes() {
   for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
          E = CUMap.end(); I != E; ++I) {
     CompileUnit *TheCU = I->second;
-    const StringMap<DIE*> &Names = TheCU->getGlobalTypes();
-    //TODO: TheCU->getAccelTypes();
+    const StringMap<DIE*> &Names = TheCU->getAccelTypes();
     for (StringMap<DIE*>::const_iterator
            GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
       const char *Name = GI->getKeyData();