[llvm-commits] [llvm] r144319 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfCompileUnit.h DwarfDebug.cpp

Eric Christopher echristo at apple.com
Thu Nov 10 13:47:55 PST 2011


Author: echristo
Date: Thu Nov 10 15:47:55 2011
New Revision: 144319

URL: http://llvm.org/viewvc/llvm-project?rev=144319&view=rev
Log:
Make types and namespaces take multiple DIEs for the accelerator tables
as well.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=144319&r1=144318&r2=144319&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Thu Nov 10 15:47:55 2011
@@ -64,8 +64,8 @@
   ///
   StringMap<std::vector<DIE*> > AccelNames;
   StringMap<std::vector<DIE*> > AccelObjC;
-  StringMap<DIE*> AccelNamespace;
-  StringMap<DIE*> AccelTypes;
+  StringMap<std::vector<DIE*> > AccelNamespace;
+  StringMap<std::vector<DIE*> > AccelTypes;
 
   /// DIEBlocks - A list of all the DIEBlocks in use.
   std::vector<DIEBlock *> DIEBlocks;
@@ -90,8 +90,12 @@
   const StringMap<std::vector<DIE*> > &getAccelObjC() const {
     return AccelObjC;
   }
-  const StringMap<DIE*> &getAccelNamespace() const { return AccelNamespace; }
-  const StringMap<DIE*> &getAccelTypes() const { return AccelTypes; }
+  const StringMap<std::vector<DIE*> > &getAccelNamespace() const {
+    return AccelNamespace;
+  }
+  const StringMap<std::vector<DIE*> > &getAccelTypes() const {
+    return AccelTypes;
+  }
   
   /// hasContent - Return true if this compile unit has something to write out.
   ///
@@ -112,10 +116,12 @@
     DIEs.push_back(Die);
   }
   void addAccelNamespace(StringRef Name, DIE *Die) {
-    AccelNamespace[Name] = Die;
+    std::vector<DIE*> &DIEs = AccelNamespace[Name];
+    DIEs.push_back(Die);
   }
   void addAccelType(StringRef Name, DIE *Die) {
-    AccelTypes[Name] = Die;
+    std::vector<DIE*> &DIEs = AccelTypes[Name];
+    DIEs.push_back(Die);
   }
   
   /// getDIE - Returns the debug information entry map slot for the

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=144319&r1=144318&r2=144319&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Nov 10 15:47:55 2011
@@ -1823,12 +1823,14 @@
   for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
          E = CUMap.end(); I != E; ++I) {
     CompileUnit *TheCU = I->second;
-    const StringMap<DIE*> &Names = TheCU->getAccelNamespace();
-    for (StringMap<DIE*>::const_iterator
+    const StringMap<std::vector<DIE*> > &Names = TheCU->getAccelNamespace();
+    for (StringMap<std::vector<DIE*> >::const_iterator
            GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
       const char *Name = GI->getKeyData();
-      DIE *Entity = GI->second;
-      AT.AddName(Name, Entity);
+      std::vector<DIE *> Entities = GI->second;
+      for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
+             DE = Entities.end(); DI != DE; ++DI)
+        AT.AddName(Name, (*DI));
     }
   }
 
@@ -1849,12 +1851,14 @@
   for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
          E = CUMap.end(); I != E; ++I) {
     CompileUnit *TheCU = I->second;
-    const StringMap<DIE*> &Names = TheCU->getAccelTypes();
-    for (StringMap<DIE*>::const_iterator
+    const StringMap<std::vector<DIE*> > &Names = TheCU->getAccelTypes();
+    for (StringMap<std::vector<DIE*> >::const_iterator
            GI = Names.begin(), GE = Names.end(); GI != GE; ++GI) {
       const char *Name = GI->getKeyData();
-      DIE *Entity = GI->second;
-      AT.AddName(Name, Entity);
+      std::vector<DIE *> Entities = GI->second;
+      for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
+             DE= Entities.end(); DI !=DE; ++DI)
+        AT.AddName(Name, (*DI));
     }
   }
 





More information about the llvm-commits mailing list