diff options
author | Eric Christopher <echristo@gmail.com> | 2014-04-25 22:23:54 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-04-25 22:23:54 +0000 |
commit | eed2620611c4eedaa4c8d1b55ce5939f66be6292 (patch) | |
tree | e4ce7408d0c4ac372dd9a673375b6192e1a4310a /lib/CodeGen | |
parent | d1f361aa39a94593a6f15a6ed25249c41c714c3a (diff) | |
download | llvm-eed2620611c4eedaa4c8d1b55ce5939f66be6292.tar.gz llvm-eed2620611c4eedaa4c8d1b55ce5939f66be6292.tar.bz2 llvm-eed2620611c4eedaa4c8d1b55ce5939f66be6292.tar.xz |
Make sure that rangelists are also relative to the compile unit
low_pc similar to location lists.
Fixes PR19563
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8f4d89a12b..32f7f42c5d 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/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. |