[llvm] r196419 - Make RangeSpanList take a symbol for the beginning of the range
Eric Christopher
echristo at gmail.com
Wed Dec 4 14:04:51 PST 2013
Author: echristo
Date: Wed Dec 4 16:04:50 2013
New Revision: 196419
URL: http://llvm.org/viewvc/llvm-project?rev=196419&view=rev
Log:
Make RangeSpanList take a symbol for the beginning of the range
rather than magically making the names match.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=196419&r1=196418&r2=196419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Dec 4 16:04:50 2013
@@ -469,9 +469,9 @@ void DwarfDebug::addScopeRangeList(Compi
const SmallVectorImpl<InsnRange> &Range) {
// Emit offset in .debug_range as a relocatable label. emitDIE will handle
// emitting it appropriately.
- TheCU->addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges,
- Asm->GetTempSymbol("debug_ranges", GlobalRangeCount));
- RangeSpanList List(GlobalRangeCount++);
+ MCSymbol *RangeSym = Asm->GetTempSymbol("debug_ranges", GlobalRangeCount++);
+ TheCU->addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, RangeSym);
+ RangeSpanList List(RangeSym);
for (SmallVectorImpl<InsnRange>::const_iterator RI = Range.begin(),
RE = Range.end();
RI != RE; ++RI) {
@@ -2940,9 +2940,8 @@ void DwarfDebug::emitDebugRanges() {
I != E; ++I) {
const RangeSpanList &List = *I;
- // Emit a symbol so we can find the beginning of the range.
- Asm->OutStreamer.EmitLabel(
- Asm->GetTempSymbol("debug_ranges", List.getIndex()));
+ // Emit our symbol so we can find the beginning of the range.
+ Asm->OutStreamer.EmitLabel(List.getSym());
for (SmallVectorImpl<RangeSpan>::const_iterator
RI = List.getRanges().begin(),
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=196419&r1=196418&r2=196419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Wed Dec 4 16:04:50 2013
@@ -45,13 +45,13 @@ private:
class RangeSpanList {
private:
// Index for locating within the debug_range section this particular span.
- unsigned Index;
+ MCSymbol *RangeSym;
// List of ranges.
SmallVector<RangeSpan, 2> Ranges;
public:
- RangeSpanList(unsigned Idx) : Index(Idx) {}
- unsigned getIndex() const { return Index; }
+ RangeSpanList(MCSymbol *Sym) : RangeSym(Sym) {}
+ MCSymbol *getSym() const { return RangeSym; }
const SmallVectorImpl<RangeSpan> &getRanges() const { return Ranges; }
void addRange(RangeSpan Range) { Ranges.push_back(Range); }
};
More information about the llvm-commits
mailing list