]> granicus.if.org Git - llvm/commitdiff
llvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.
authorAdrian Prantl <aprantl@apple.com>
Mon, 18 Sep 2017 19:55:00 +0000 (19:55 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 18 Sep 2017 19:55:00 +0000 (19:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313560 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFContext.cpp
lib/DebugInfo/DWARF/DWARFDie.cpp

index 353a5bad997d36f3d74b429acc1a7335bc702e1a..0aacd0c52310f390d60456c1f5b32a81bce39c4a 100644 (file)
@@ -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);
   };
index 1af9c8001bb99ccda83ed1b4d71acd807e0b06a6..57734984d75719ea9be47d9d9840bbe418956a54 100644 (file)
@@ -374,6 +374,7 @@ void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth, unsigned Indent,
   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);