summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DIE.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
index eb3a622ae7f..34f070e0edb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -559,13 +559,15 @@ unsigned DIELocList::SizeOf(AsmPrinter *AP, dwarf::Form Form) const {
/// EmitValue - Emit label value.
///
void DIELocList::EmitValue(AsmPrinter *AP, dwarf::Form Form) const {
+ DwarfDebug *DD = AP->getDwarfDebug();
MCSymbol *Label = AP->GetTempSymbol("debug_loc", Index);
- MCSymbol *DwarfDebugLocSectionSym = AP->getDwarfDebug()->getDebugLocSym();
- if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
- AP->EmitSectionOffset(Label, DwarfDebugLocSectionSym);
+ if (DD->useSplitDwarf())
+ AP->EmitLabelDifference(Label, DD->getDebugLocDWOSym(), 4);
+ else if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
+ AP->EmitSectionOffset(Label, DD->getDebugLocSym());
else
- AP->EmitLabelDifference(Label, DwarfDebugLocSectionSym, 4);
+ AP->EmitLabelDifference(Label, DD->getDebugLocSym(), 4);
}
#ifndef NDEBUG
OpenPOWER on IntegriCloud