diff options
author | Eric Christopher <echristo@gmail.com> | 2013-12-05 00:36:17 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-12-05 00:36:17 +0000 |
commit | c31fe2de4a824858c1d13a42d6fa68a5597cadb3 (patch) | |
tree | fdb81efce569dfd96c6af3cc94d357ae0a178d80 | |
parent | ee36595ce6fcf2046bf48f762cea3eadba480d00 (diff) | |
download | bcm5719-llvm-c31fe2de4a824858c1d13a42d6fa68a5597cadb3.tar.gz bcm5719-llvm-c31fe2de4a824858c1d13a42d6fa68a5597cadb3.zip |
Remove special handling for DW_AT_ranges support by constructing the
values with the correct behavior.
llvm-svn: 196441
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 3e4b38569d5..fc37a25fe73 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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()) |