diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-05 23:14:16 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-05 23:14:16 +0000 |
commit | e1a26a624d3612d98af13c47ee43f100bd458199 (patch) | |
tree | 44130f759367d47fd8f0a6506f8a5d2f527b5f1d /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 57fbc0c35fb143b0acce549f82e536ea4022634f (diff) | |
download | bcm5719-llvm-e1a26a624d3612d98af13c47ee43f100bd458199.tar.gz bcm5719-llvm-e1a26a624d3612d98af13c47ee43f100bd458199.zip |
DebugInfo: Move the reference to the CU from the location list entry to the list itself, since it is constant across an entire list.
This simplifies construction and usage while making the data structure
smaller. It was a holdover from the days when we didn't have a separate
DebugLocList and all we had was a flat list of DebugLocEntries.
llvm-svn: 214933
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c94eeb943c9..ee23a1c5d22 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1229,10 +1229,9 @@ static bool piecesOverlap(DIVariable P1, DIVariable P2) { // [1-3] [x, (reg0, piece 0, 32), (reg1, piece 32, 32)] // [3-4] [x, (reg1, piece 32, 32)] // [4- ] [x, (mem, piece 0, 64)] -void DwarfDebug:: -buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, - const DbgValueHistoryMap::InstrRanges &Ranges, - DwarfCompileUnit *TheCU) { +void +DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, + const DbgValueHistoryMap::InstrRanges &Ranges) { typedef std::pair<DIVariable, DebugLocEntry::Value> Range; SmallVector<Range, 4> OpenRanges; @@ -1271,7 +1270,7 @@ buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc, DEBUG(dbgs() << "DotDebugLoc: " << *Begin << "\n"); auto Value = getDebugLocValue(Begin); - DebugLocEntry Loc(StartLabel, EndLabel, Value, TheCU); + DebugLocEntry Loc(StartLabel, EndLabel, Value); if (DebugLoc.empty() || !DebugLoc.back().Merge(Loc)) { // Add all values from still valid non-overlapping pieces. for (auto Range : OpenRanges) @@ -1340,11 +1339,12 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) { DotDebugLocEntries.resize(DotDebugLocEntries.size() + 1); DebugLocList &LocList = DotDebugLocEntries.back(); + LocList.CU = TheCU; LocList.Label = Asm->GetTempSymbol("debug_loc", DotDebugLocEntries.size() - 1); // Build the location list for this variable. - buildLocationList(LocList.List, Ranges, TheCU); + buildLocationList(LocList.List, Ranges); } // Collect info for variables that were optimized out. @@ -2198,11 +2198,11 @@ void DwarfDebug::emitDebugLoc() { unsigned char Size = Asm->getDataLayout().getPointerSize(); for (const auto &DebugLoc : DotDebugLocEntries) { Asm->OutStreamer.EmitLabel(DebugLoc.Label); + const DwarfCompileUnit *CU = DebugLoc.CU; for (const auto &Entry : DebugLoc.List) { // Set up the range. This range is relative to the entry point of the // compile unit. This is a hard coded 0 for low_pc when we're emitting // ranges, or the DW_AT_low_pc on the compile unit otherwise. - const DwarfCompileUnit *CU = Entry.getCU(); if (CU->getRanges().size() == 1) { // Grab the begin symbol from the first range as our base. const MCSymbol *Base = CU->getRanges()[0].getStart(); |