From 856d2fc052b57cab283a6eefc3f3819e4e37beb5 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 4 Dec 2013 22:04:50 +0000 Subject: Make RangeSpanList take a symbol for the beginning of the range rather than magically making the names match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196419 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 +++++------ lib/CodeGen/AsmPrinter/DwarfUnit.h | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 98cb0fb907..c33042db34 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -469,9 +469,9 @@ void DwarfDebug::addScopeRangeList(CompileUnit *TheCU, DIE *ScopeDIE, const SmallVectorImpl &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::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::const_iterator RI = List.getRanges().begin(), diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index ce9faf0250..f862310067 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -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 Ranges; public: - RangeSpanList(unsigned Idx) : Index(Idx) {} - unsigned getIndex() const { return Index; } + RangeSpanList(MCSymbol *Sym) : RangeSym(Sym) {} + MCSymbol *getSym() const { return RangeSym; } const SmallVectorImpl &getRanges() const { return Ranges; } void addRange(RangeSpan Range) { Ranges.push_back(Range); } }; -- cgit v1.2.3