[llvm] r344794 - [dwarfdump] Hide ranges in diff-mode.

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 10:57:53 PDT 2018


Author: jdevlieghere
Date: Fri Oct 19 10:57:53 2018
New Revision: 344794

URL: http://llvm.org/viewvc/llvm-project?rev=344794&view=rev
Log:
[dwarfdump] Hide ranges in diff-mode.

llvm-dwarfdump --diff should not print DW_AT_ranges. This patch fixes
that.

Differential revision: https://reviews.llvm.org/D53353

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
    llvm/trunk/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=344794&r1=344793&r2=344794&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Fri Oct 19 10:57:53 2018
@@ -59,12 +59,14 @@ static void dumpRanges(const DWARFObject
                        const DWARFAddressRangesVector &Ranges,
                        unsigned AddressSize, unsigned Indent,
                        const DIDumpOptions &DumpOpts) {
+  if (!DumpOpts.ShowAddresses)
+    return;
+
   ArrayRef<SectionName> SectionNames;
   if (DumpOpts.Verbose)
     SectionNames = Obj.getSectionNames();
 
   for (const DWARFAddressRange &R : Ranges) {
-
     OS << '\n';
     OS.indent(Indent);
     R.dump(OS, AddressSize);

Modified: llvm/trunk/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s?rev=344794&r1=344793&r2=344794&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s (original)
+++ llvm/trunk/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s Fri Oct 19 10:57:53 2018
@@ -21,6 +21,16 @@
 # BRIEF-NEXT:  [0x0000000000000000, 0x0000000000000002)
 # BRIEF-NEXT:  [0x0000000000000000, 0x0000000000000003))
 
+# RUN: llvm-dwarfdump -diff %t | FileCheck %s --check-prefix=DIFF
+# DIFF: DW_TAG_compile_unit
+# DIFF-NEXT: DW_AT_producer	()
+# DIFF-NEXT: DW_AT_language	(DW_LANG_C_plus_plus)
+# DIFF-NEXT: DW_AT_name	()
+# DIFF-NEXT: DW_AT_stmt_list	()
+# DIFF-NEXT: DW_AT_comp_dir	()
+# DIFF-NEXT: DW_AT_low_pc	()
+# DIFF-NEXT: DW_AT_ranges	()
+
 ## Asm code for testcase is a reduced and modified output from next
 ## invocation and source:
 # clang test.cpp -S -o test.s -gmlt -ffunction-sections




More information about the llvm-commits mailing list