diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfFile.h | 11 |
4 files changed, 11 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index a32cd8bc904..d93c7f6c845 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -430,8 +430,7 @@ void DwarfCompileUnit::addScopeRangeList(DIE &ScopeDIE, // Add the range list to the set of ranges to be emitted. auto IndexAndList = (DD->getDwarfVersion() < 5 && Skeleton ? Skeleton->DU : DU) - ->addRange((Skeleton ? Skeleton->BaseAddress : BaseAddress), - std::move(Range)); + ->addRange(*(Skeleton ? Skeleton : this), std::move(Range)); uint32_t Index = IndexAndList.first; auto &List = *IndexAndList.second; diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2807734969a..070b8fe4ec1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2275,7 +2275,8 @@ static void emitRangeList(DwarfDebug &DD, AsmPrinter *Asm, for (const RangeSpan &Range : List.getRanges()) SectionRanges[&Range.getStart()->getSection()].push_back(&Range); - const MCSymbol *CUBase = List.getBaseAddress(); + const DwarfCompileUnit &CU = List.getCU(); + const MCSymbol *CUBase = CU.getBaseAddress(); bool BaseIsSet = false; for (const auto &P : SectionRanges) { // Don't bother with a base address entry if there's only one range in diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp index 1e5b7f18958..4e410bb49be 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp @@ -111,9 +111,8 @@ void DwarfFile::addScopeLabel(LexicalScope *LS, DbgLabel *Label) { } std::pair<uint32_t, RangeSpanList *> -DwarfFile::addRange(const MCSymbol *&CUBaseAddress, - SmallVector<RangeSpan, 2> R) { - CURangeLists.push_back(RangeSpanList(Asm->createTempSymbol("debug_ranges"), - CUBaseAddress, std::move(R))); +DwarfFile::addRange(const DwarfCompileUnit &CU, SmallVector<RangeSpan, 2> R) { + CURangeLists.push_back( + RangeSpanList(Asm->createTempSymbol("debug_ranges"), CU, std::move(R))); return std::make_pair(CURangeLists.size() - 1, &CURangeLists.back()); } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h index 1e5c99e26eb..51acca8c1e5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h @@ -48,17 +48,16 @@ class RangeSpanList { private: // Index for locating within the debug_range section this particular span. MCSymbol *RangeSym; - const MCSymbol **CUBaseAddress; + const DwarfCompileUnit *CU; // List of ranges. SmallVector<RangeSpan, 2> Ranges; public: - RangeSpanList(MCSymbol *Sym, const MCSymbol *&CUBaseAddress, + RangeSpanList(MCSymbol *Sym, const DwarfCompileUnit &CU, SmallVector<RangeSpan, 2> Ranges) - : RangeSym(Sym), CUBaseAddress(&CUBaseAddress), - Ranges(std::move(Ranges)) {} + : RangeSym(Sym), CU(&CU), Ranges(std::move(Ranges)) {} MCSymbol *getSym() const { return RangeSym; } - const MCSymbol *&getBaseAddress() const { return *CUBaseAddress; } + const DwarfCompileUnit &getCU() const { return *CU; } const SmallVectorImpl<RangeSpan> &getRanges() const { return Ranges; } void addRange(RangeSpan Range) { Ranges.push_back(Range); } }; @@ -123,7 +122,7 @@ public: return CUs; } - std::pair<uint32_t, RangeSpanList *> addRange(const MCSymbol *&CUBaseAddress, + std::pair<uint32_t, RangeSpanList *> addRange(const DwarfCompileUnit &CU, SmallVector<RangeSpan, 2> R); /// getRangeLists - Get the vector of range lists. |