[llvm] 33529ba - llvm-dwarfdump --summarize-types: skip compilation units

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 20:36:19 PST 2022


Author: David Blaikie
Date: 2022-01-05T20:36:04-08:00
New Revision: 33529ba0cb2bcfb04ce05d8be6075a19238ae172

URL: https://github.com/llvm/llvm-project/commit/33529ba0cb2bcfb04ce05d8be6075a19238ae172
DIFF: https://github.com/llvm/llvm-project/commit/33529ba0cb2bcfb04ce05d8be6075a19238ae172.diff

LOG: llvm-dwarfdump --summarize-types: skip compilation units

Important for DWARFv5 debug info which might contain type units in the
debug_info section, which made summarize-types fairly ineffective/lost
amongst the noise of CUs being dumped.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
    llvm/test/DebugInfo/dwarfdump-type-units.test

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
index 6e30309ae94a9..d68ecd4f8a423 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
@@ -15,6 +15,8 @@
 using namespace llvm;
 
 void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
+  if (DumpOpts.SummarizeTypes)
+    return;
   int OffsetDumpWidth = 2 * dwarf::getDwarfOffsetByteSize(getFormat());
   OS << format("0x%08" PRIx64, getOffset()) << ": Compile Unit:"
      << " length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())

diff  --git a/llvm/test/DebugInfo/dwarfdump-type-units.test b/llvm/test/DebugInfo/dwarfdump-type-units.test
index 5048ca097e8d0..f34721de66d34 100644
--- a/llvm/test/DebugInfo/dwarfdump-type-units.test
+++ b/llvm/test/DebugInfo/dwarfdump-type-units.test
@@ -1,5 +1,5 @@
 RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=INFO -check-prefix=CHECK -check-prefix=LONG %s
-RUN: llvm-dwarfdump -debug-types %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -implicit-check-not=DW_ -check-prefix=CHECK -check-prefix=SHORT %s
+RUN: llvm-dwarfdump -debug-types -debug-info %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -implicit-check-not=DW_ -check-prefix=CHECK -check-prefix=SHORT %s
 RUN: llvm-dwarfdump -v -debug-types %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=TYPES %s
 
 INFO: debug_info contents:


        


More information about the llvm-commits mailing list