[llvm-commits] [llvm] r139671 - in /llvm/trunk/lib/DebugInfo: DWARFCompileUnit.cpp DWARFDebugInfoEntry.cpp DWARFDebugInfoEntry.h

Benjamin Kramer benny.kra at googlemail.com
Tue Sep 13 17:15:32 PDT 2011


Author: d0k
Date: Tue Sep 13 19:15:32 2011
New Revision: 139671

URL: http://llvm.org/viewvc/llvm-project?rev=139671&view=rev
Log:
DebugInfo: Don't print DIEs multiple times.

Modified:
    llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp
    llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp
    llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h

Modified: llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp?rev=139671&r1=139670&r2=139671&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARFCompileUnit.cpp Tue Sep 13 19:15:32 2011
@@ -95,8 +95,7 @@
      << ")\n";
 
   extractDIEsIfNeeded(false);
-  for (unsigned i = 0, e = DieArray.size(); i != e; ++i)
-    DieArray[i].dump(OS, this, 10);
+  DieArray[0].dump(OS, this, -1U);
 }
 
 void DWARFCompileUnit::setDIERelations() {

Modified: llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp?rev=139671&r1=139670&r2=139671&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp Tue Sep 13 19:15:32 2011
@@ -45,12 +45,10 @@
 
         const DWARFDebugInfoEntryMinimal *child = getFirstChild();
         if (recurseDepth > 0 && child) {
-          indent += 2;
           while (child) {
-            child->dump(OS, cu, recurseDepth-1, indent);
+            child->dump(OS, cu, recurseDepth-1, indent+2);
             child = child->getSibling();
           }
-          indent -= 2;
         }
       } else {
         OS << "Abbreviation code not found in 'debug_abbrev' class for code: "

Modified: llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h?rev=139671&r1=139670&r2=139671&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h (original)
+++ llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.h Tue Sep 13 19:15:32 2011
@@ -33,6 +33,9 @@
 
   const DWARFAbbreviationDeclaration *AbbrevDecl;
 public:
+  DWARFDebugInfoEntryMinimal()
+    : Offset(0), ParentIdx(0), SiblingIdx(0), AbbrevDecl(0) {}
+
   void dump(raw_ostream &OS, const DWARFCompileUnit *cu,
             unsigned recurseDepth, unsigned indent = 0) const;
   void dumpAttribute(raw_ostream &OS, const DWARFCompileUnit *cu,





More information about the llvm-commits mailing list