summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-12-05 00:36:17 +0000
committerEric Christopher <echristo@gmail.com>2013-12-05 00:36:17 +0000
commit7eca7002f292e4a65c923a88d4e9b56215678b5b (patch)
tree0ba330fc2ac18f7b38154509b88e4705b5e503b3 /lib
parent175fe6839353fe3659adba11c1f2b11d3451e7dc (diff)
downloadllvm-7eca7002f292e4a65c923a88d4e9b56215678b5b.tar.gz
llvm-7eca7002f292e4a65c923a88d4e9b56215678b5b.tar.bz2
llvm-7eca7002f292e4a65c923a88d4e9b56215678b5b.tar.xz
Remove special handling for DW_AT_ranges support by constructing the
values with the correct behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 3e4b38569d..fc37a25fe7 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -465,12 +465,23 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) {
return !End;
}
+static void addSectionLabel(AsmPrinter *Asm, Unit *U, DIE *D,
+ dwarf::Attribute A, const MCSymbol *L,
+ const MCSymbol *Sec) {
+ if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
+ U->addSectionLabel(D, A, L);
+ else
+ U->addSectionDelta(D, A, L, Sec);
+}
+
void DwarfDebug::addScopeRangeList(CompileUnit *TheCU, DIE *ScopeDIE,
const SmallVectorImpl<InsnRange> &Range) {
// Emit offset in .debug_range as a relocatable label. emitDIE will handle
// emitting it appropriately.
MCSymbol *RangeSym = Asm->GetTempSymbol("debug_ranges", GlobalRangeCount++);
- TheCU->addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, RangeSym);
+ addSectionLabel(Asm, TheCU, ScopeDIE, dwarf::DW_AT_ranges, RangeSym,
+ DwarfDebugRangeSectionSym);
+
RangeSpanList List(RangeSym);
for (SmallVectorImpl<InsnRange>::const_iterator RI = Range.begin(),
RE = Range.end();
@@ -724,15 +735,6 @@ unsigned DwarfDebug::getOrCreateSourceID(StringRef FileName, StringRef DirName,
return SrcId;
}
-static void addSectionLabel(AsmPrinter *Asm, Unit *U, DIE *D,
- dwarf::Attribute A, const MCSymbol *L,
- const MCSymbol *Sec) {
- if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
- U->addSectionLabel(D, A, L);
- else
- U->addSectionDelta(D, A, L, Sec);
-}
-
void DwarfDebug::addGnuPubAttributes(Unit *U, DIE *D) const {
if (!GenerateGnuPubSections)
return;
@@ -2086,16 +2088,6 @@ void DwarfDebug::emitDIE(DIE *Die, ArrayRef<DIEAbbrev *> Abbrevs) {
}
break;
}
- case dwarf::DW_AT_ranges: {
- // DW_AT_range Value encodes offset in debug_range section.
- DIELabel *V = cast<DIELabel>(Values[i]);
-
- if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
- Asm->EmitSectionOffset(V->getValue(), DwarfDebugRangeSectionSym);
- else
- Asm->EmitLabelDifference(V->getValue(), DwarfDebugRangeSectionSym, 4);
- break;
- }
case dwarf::DW_AT_location: {
if (DIELabel *L = dyn_cast<DIELabel>(Values[i])) {
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())