[llvm] r313560 - llvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 12:55:00 PDT 2017
Author: adrian
Date: Mon Sep 18 12:55:00 2017
New Revision: 313560
URL: http://llvm.org/viewvc/llvm-project?rev=313560&view=rev
Log:
llvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.
Modified:
llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp?rev=313560&r1=313559&r2=313560&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFContext.cpp Mon Sep 18 12:55:00 2017
@@ -222,8 +222,6 @@ void DWARFContext::dump(
Optional<uint64_t> DumpOffset;
uint64_t DumpType = DumpOpts.DumpType;
- unsigned RecDepth =
- DumpOpts.ShowChildren ? std::numeric_limits<unsigned>::max() : 0;
StringRef Extension = sys::path::extension(DObj->getFileName());
bool IsDWO = (Extension == ".dwo") || (Extension == ".dwp");
@@ -261,7 +259,7 @@ void DWARFContext::dump(
if (shouldDump(IsExplicit, Name, DIDT_ID_DebugInfo, Section.Data)) {
for (const auto &CU : CUs)
if (DumpOffset)
- CU->getDIEForOffset(DumpOffset.getValue()).dump(OS, RecDepth);
+ CU->getDIEForOffset(DumpOffset.getValue()).dump(OS, 0, 0, DumpOpts);
else
CU->dump(OS, DumpOpts);
}
@@ -278,7 +276,7 @@ void DWARFContext::dump(
for (const auto &TUS : TUSections)
for (const auto &TU : TUS)
if (DumpOffset)
- TU->getDIEForOffset(*DumpOffset).dump(OS, RecDepth);
+ TU->getDIEForOffset(*DumpOffset).dump(OS, 0, 0, DumpOpts);
else
TU->dump(OS, DumpOpts);
};
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=313560&r1=313559&r2=313560&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Mon Sep 18 12:55:00 2017
@@ -374,6 +374,7 @@ void DWARFDie::dump(raw_ostream &OS, uns
DWARFDataExtractor debug_info_data = U->getDebugInfoExtractor();
const uint32_t Offset = getOffset();
uint32_t offset = Offset;
+ RecurseDepth += DumpOpts.ShowChildren ? 1 : 0;
if (debug_info_data.isValidOffset(offset)) {
uint32_t abbrCode = debug_info_data.getULEB128(&offset);
More information about the llvm-commits
mailing list