[llvm] r309630 - DebugInfo: Put range base specifier entry functionality behind a flag

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 14:48:42 PDT 2017


Author: dblaikie
Date: Mon Jul 31 14:48:42 2017
New Revision: 309630

URL: http://llvm.org/viewvc/llvm-project?rev=309630&view=rev
Log:
DebugInfo: Put range base specifier entry functionality behind a flag

Chromium's gold build seems to have trouble with this (gold produces
errors) - not sure if it's gold that's not coping with the valid
representation, or a bug in the implementation in LLVM, etc.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/DebugInfo/X86/range_reloc.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=309630&r1=309629&r2=309630&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jul 31 14:48:42 2017
@@ -61,10 +61,14 @@ static cl::opt<bool>
 DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden,
                          cl::desc("Disable debug info printing"));
 
+static cl::opt<bool> UseDwarfRangesBaseAddressSpecifier(
+    "use-dwarf-ranges-base-address-specifier", cl::Hidden,
+    cl::desc("Disable debug info printing"), cl::init(false));
+
 static cl::opt<bool>
-GenerateGnuPubSections("generate-gnu-dwarf-pub-sections", cl::Hidden,
-                       cl::desc("Generate GNU-style pubnames and pubtypes"),
-                       cl::init(false));
+    GenerateGnuPubSections("generate-gnu-dwarf-pub-sections", cl::Hidden,
+                           cl::desc("Generate GNU-style pubnames and pubtypes"),
+                           cl::init(false));
 
 static cl::opt<bool> GenerateARangeSection("generate-arange-section",
                                            cl::Hidden,
@@ -1882,7 +1886,8 @@ void DwarfDebug::emitDebugRanges() {
         // or optnone where there may be holes in a single CU's section
         // contrubutions.
         auto *Base = CUBase;
-        if (!Base && P.second.size() > 1) {
+        if (!Base && P.second.size() > 1 &&
+            UseDwarfRangesBaseAddressSpecifier) {
           BaseIsSet = true;
           // FIXME/use care: This may not be a useful base address if it's not
           // the lowest address/range in this object.

Modified: llvm/trunk/test/DebugInfo/X86/range_reloc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/range_reloc.ll?rev=309630&r1=309629&r2=309630&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/range_reloc.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/range_reloc.ll Mon Jul 31 14:48:42 2017
@@ -1,4 +1,5 @@
-; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - | FileCheck %s
+; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - -use-dwarf-ranges-base-address-specifier | FileCheck --check-prefix=COMMON --check-prefix=BASE %s
+; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - | FileCheck --check-prefix=COMMON --check-prefix=NOBASE %s
 
 ; Group ranges in a range list that apply to the same section and use a base
 ; address selection entry to reduce the number of relocations to one reloc per
@@ -13,23 +14,27 @@
 ; in the linked executable. Without compression in the objects, the win would be
 ; smaller (the growth of debug_ranges itself would be more significant).
 
-; CHECK: {{^.Ldebug_ranges0}}
-; CHECK-NEXT:   .quad   .Lfunc_begin0
-; CHECK-NEXT:   .quad   .Lfunc_end0
-; CHECK-NEXT:   .quad   -1
-; CHECK-NEXT:   .quad   .Lfunc_begin1
-; CHECK-NEXT:   .quad   .Lfunc_begin1-.Lfunc_begin1
-; CHECK-NEXT:   .quad   .Lfunc_end1-.Lfunc_begin1
-; CHECK-NEXT:   .quad   .Lfunc_begin3-.Lfunc_begin1
-; CHECK-NEXT:   .quad   .Lfunc_end3-.Lfunc_begin1
-; CHECK-NEXT:   .quad   -1
-; CHECK-NEXT:   .quad   0
-; CHECK-NEXT:   .quad   .Lfunc_begin4
-; CHECK-NEXT:   .quad   .Lfunc_end4
-; CHECK-NEXT:   .quad   .Lfunc_begin5
-; CHECK-NEXT:   .quad   .Lfunc_end5
-; CHECK-NEXT:   .quad   0
-; CHECK-NEXT:   .quad   0
+; COMMON: {{^.Ldebug_ranges0}}
+; COMMON-NEXT:   .quad   .Lfunc_begin0
+; COMMON-NEXT:   .quad   .Lfunc_end0
+; BASE-NEXT:   .quad   -1
+; BASE-NEXT:   .quad   .Lfunc_begin1
+; BASE-NEXT:   .quad   .Lfunc_begin1-.Lfunc_begin1
+; BASE-NEXT:   .quad   .Lfunc_end1-.Lfunc_begin1
+; BASE-NEXT:   .quad   .Lfunc_begin3-.Lfunc_begin1
+; BASE-NEXT:   .quad   .Lfunc_end3-.Lfunc_begin1
+; BASE-NEXT:   .quad   -1
+; BASE-NEXT:   .quad   0
+; NOBASE-NEXT:   .quad   .Lfunc_begin1
+; NOBASE-NEXT:   .quad   .Lfunc_end1
+; NOBASE-NEXT:   .quad   .Lfunc_begin3
+; NOBASE-NEXT:   .quad   .Lfunc_end3
+; COMMON-NEXT:   .quad   .Lfunc_begin4
+; COMMON-NEXT:   .quad   .Lfunc_end4
+; COMMON-NEXT:   .quad   .Lfunc_begin5
+; COMMON-NEXT:   .quad   .Lfunc_end5
+; COMMON-NEXT:   .quad   0
+; COMMON-NEXT:   .quad   0
 
 ; Function Attrs: noinline nounwind optnone uwtable
 define void @_Z2f1v() #0 section "a" !dbg !7 {




More information about the llvm-commits mailing list