summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-07-31 21:48:42 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-07-31 21:48:42 +0000
commit038e28a5a71b63c145e6587eac3bfbf2a7ea1f44 (patch)
tree7494c9da8300653e9861ce17d2e32834b92da9ed
parent7dd26785e7a048b554f1438e9707b2032d3bbbd4 (diff)
downloadbcm5719-llvm-038e28a5a71b63c145e6587eac3bfbf2a7ea1f44.tar.gz
bcm5719-llvm-038e28a5a71b63c145e6587eac3bfbf2a7ea1f44.zip
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. llvm-svn: 309630
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
-rw-r--r--llvm/test/DebugInfo/X86/range_reloc.ll41
2 files changed, 32 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index ea1a170c1c2..13c5203fa55 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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.
diff --git a/llvm/test/DebugInfo/X86/range_reloc.ll b/llvm/test/DebugInfo/X86/range_reloc.ll
index 1997c8e0a28..0ba9961e10a 100644
--- a/llvm/test/DebugInfo/X86/range_reloc.ll
+++ b/llvm/test/DebugInfo/X86/range_reloc.ll
@@ -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 {
OpenPOWER on IntegriCloud