summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-09-02 16:43:44 +0000
committerDevang Patel <dpatel@apple.com>2010-09-02 16:43:44 +0000
commitda3ef85460d62f99192cee75b8092d016d6b619c (patch)
tree07857e8db780b2036103cdbe09c25322165a8ecd /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent5d43a35e6d8592aa27822010d6cd44e00960d24d (diff)
downloadbcm5719-llvm-da3ef85460d62f99192cee75b8092d016d6b619c.tar.gz
bcm5719-llvm-da3ef85460d62f99192cee75b8092d016d6b619c.zip
Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 6edce5a2cd9..c886a5ecc61 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -3130,10 +3130,17 @@ void DwarfDebug::emitDIE(DIE *Die) {
case dwarf::DW_AT_ranges: {
// DW_AT_range Value encodes offset in debug_range section.
DIEInteger *V = cast<DIEInteger>(Values[i]);
- Asm->EmitLabelOffsetDifference(DwarfDebugRangeSectionSym,
- V->getValue(),
- DwarfDebugRangeSectionSym,
- 4);
+
+ if (Asm->MAI->doesDwarfUsesLabelOffsetForRanges()) {
+ Asm->EmitLabelPlusOffset(DwarfDebugRangeSectionSym,
+ V->getValue(),
+ 4);
+ } else {
+ Asm->EmitLabelOffsetDifference(DwarfDebugRangeSectionSym,
+ V->getValue(),
+ DwarfDebugRangeSectionSym,
+ 4);
+ }
break;
}
case dwarf::DW_AT_location: {
OpenPOWER on IntegriCloud