summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-04-25 22:23:54 +0000
committerEric Christopher <echristo@gmail.com>2014-04-25 22:23:54 +0000
commitece0e90e338ef61194edf3fcd938785dbc446ff7 (patch)
treee7c84a2414c12a69f6bca9d68e97521af9001b39 /llvm/lib
parentde1c3410c3d5cf2b4f0b83b24f4f64344116ed4d (diff)
downloadbcm5719-llvm-ece0e90e338ef61194edf3fcd938785dbc446ff7.tar.gz
bcm5719-llvm-ece0e90e338ef61194edf3fcd938785dbc446ff7.zip
Make sure that rangelists are also relative to the compile unit
low_pc similar to location lists. Fixes PR19563 llvm-svn: 207283
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8f4d89a12b1..32f7f42c5d1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2355,8 +2355,15 @@ void DwarfDebug::emitDebugRanges() {
const MCSymbol *End = Range.getEnd();
assert(Begin && "Range without a begin symbol?");
assert(End && "Range without an end symbol?");
- Asm->OutStreamer.EmitSymbolValue(Begin, Size);
- Asm->OutStreamer.EmitSymbolValue(End, Size);
+ if (TheCU->getRanges().size() == 1) {
+ // Grab the begin symbol from the first range as our base.
+ const MCSymbol *Base = TheCU->getRanges()[0].getStart();
+ Asm->EmitLabelDifference(Begin, Base, Size);
+ Asm->EmitLabelDifference(End, Base, Size);
+ } else {
+ Asm->OutStreamer.EmitSymbolValue(Begin, Size);
+ Asm->OutStreamer.EmitSymbolValue(End, Size);
+ }
}
// And terminate the list with two 0 values.
OpenPOWER on IntegriCloud