aboutsummaryrefslogtreecommitdiffstats
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-09-14 00:15:32 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-09-14 00:15:32 +0000
commit15ec085c40cf45726a5c8925706795b52fd231bd (patch)
treecf9e8078e18b77db9652ef418c7e8929525d9bff /lib/DebugInfo
parente640a228f6b1ff280d35a6a33bf78c7e544f9926 (diff)
downloadexternal_llvm-15ec085c40cf45726a5c8925706795b52fd231bd.zip
external_llvm-15ec085c40cf45726a5c8925706795b52fd231bd.tar.gz
external_llvm-15ec085c40cf45726a5c8925706795b52fd231bd.tar.bz2
DebugInfo: Don't print DIEs multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARFCompileUnit.cpp3
-rw-r--r--lib/DebugInfo/DWARFDebugInfoEntry.cpp4
-rw-r--r--lib/DebugInfo/DWARFDebugInfoEntry.h3
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/DebugInfo/DWARFCompileUnit.cpp b/lib/DebugInfo/DWARFCompileUnit.cpp
index 389de9d..224ae92 100644
--- a/lib/DebugInfo/DWARFCompileUnit.cpp
+++ b/lib/DebugInfo/DWARFCompileUnit.cpp
@@ -95,8 +95,7 @@ void DWARFCompileUnit::dump(raw_ostream &OS) {
<< ")\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() {
diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index bfe89dd..6923f6c 100644
--- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp
@@ -45,12 +45,10 @@ void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS,
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: "
diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.h b/lib/DebugInfo/DWARFDebugInfoEntry.h
index 0b0a00c..5e7b89b 100644
--- a/lib/DebugInfo/DWARFDebugInfoEntry.h
+++ b/lib/DebugInfo/DWARFDebugInfoEntry.h
@@ -33,6 +33,9 @@ class DWARFDebugInfoEntryMinimal {
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,