[llvm] r196601 - DwarfDebug: Walk skeletons during fission pubtypes/pubnames emission

David Blaikie dblaikie at gmail.com
Fri Dec 6 11:38:49 PST 2013


Author: dblaikie
Date: Fri Dec  6 13:38:49 2013
New Revision: 196601

URL: http://llvm.org/viewvc/llvm-project?rev=196601&view=rev
Log:
DwarfDebug: Walk skeletons during fission pubtypes/pubnames emission

This more accurately represents the actual walk - pubnames/pubtypes are
emitted into the .o, not the .dwo, and reference the skeletons not the
full units.

Use the newly established ID->index invariant to lookup the underlying
full unit to retrieve its public names and types.

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=196601&r1=196600&r2=196601&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Dec  6 13:38:49 2013
@@ -2411,10 +2411,10 @@ void DwarfDebug::emitDebugPubNames(bool
       GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubNamesSection()
                : Asm->getObjFileLowering().getDwarfPubNamesSection();
 
-  for (SmallVectorImpl<Unit *>::const_iterator I = getUnits().begin(),
-                                               E = getUnits().end();
-       I != E; ++I) {
-    Unit *TheU = *I;
+  DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+  const SmallVectorImpl<Unit *> &Units = Holder.getUnits();
+  for (unsigned i = 0; i != Units.size(); ++i) {
+    Unit *TheU = Units[i];
     unsigned ID = TheU->getUniqueID();
 
     // Start the dwarf pubnames section.
@@ -2445,7 +2445,7 @@ void DwarfDebug::emitDebugPubNames(bool
                              4);
 
     // Emit the pubnames for this compilation unit.
-    const StringMap<const DIE *> &Globals = TheU->getGlobalNames();
+    const StringMap<const DIE *> &Globals = getUnits()[ID]->getGlobalNames();
     for (StringMap<const DIE *>::const_iterator GI = Globals.begin(),
                                                 GE = Globals.end();
          GI != GE; ++GI) {
@@ -2479,10 +2479,10 @@ void DwarfDebug::emitDebugPubTypes(bool
       GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubTypesSection()
                : Asm->getObjFileLowering().getDwarfPubTypesSection();
 
-  for (SmallVectorImpl<Unit *>::const_iterator I = getUnits().begin(),
-                                               E = getUnits().end();
-       I != E; ++I) {
-    Unit *TheU = *I;
+  DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
+  const SmallVectorImpl<Unit *> &Units = Holder.getUnits();
+  for (unsigned i = 0; i != Units.size(); ++i) {
+    Unit *TheU = Units[i];
     unsigned ID = TheU->getUniqueID();
 
     // Start the dwarf pubtypes section.
@@ -2514,7 +2514,7 @@ void DwarfDebug::emitDebugPubTypes(bool
         Asm->GetTempSymbol(ISec->getLabelBeginName(), TheU->getUniqueID()), 4);
 
     // Emit the pubtypes.
-    const StringMap<const DIE *> &Globals = TheU->getGlobalTypes();
+    const StringMap<const DIE *> &Globals = getUnits()[ID]->getGlobalTypes();
     for (StringMap<const DIE *>::const_iterator GI = Globals.begin(),
                                                 GE = Globals.end();
          GI != GE; ++GI) {





More information about the llvm-commits mailing list