From 6feef56d1bdb471d0415afedebfbe49c91ca1dce Mon Sep 17 00:00:00 2001 From: David Stenberg Date: Wed, 10 Apr 2019 09:07:43 +0000 Subject: [DebugInfo] Rename DbgValueHistoryMap::{InstrRange -> Entry}, NFC Summary: In an upcoming commit the history map will be changed so that it contains explicit entries for instructions that clobber preceding debug values, rather than Begin- End range pairs, so generalize the name to "Entry". Also, prefix the iterator variable names in buildLocationList() with "E". In an upcoming commit the entry will have query functions such as "isD(e)b(u)gValue", which could at a glance make one confuse it for iterations over MachineInstrs, so make the iterator names a bit more distinct to avoid that. Reviewers: aprantl Reviewed By: aprantl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59939 llvm-svn: 358060 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 1547822b695..07232b5082a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1117,14 +1117,13 @@ static DebugLocEntry::Value getDebugLocValue(const MachineInstr *MI) { // [1-3] [x, (reg0, fragment 0, 32), (reg1, fragment 32, 32)] // [3-4] [x, (reg1, fragment 32, 32)] // [4- ] [x, (mem, fragment 0, 64)] -void -DwarfDebug::buildLocationList(SmallVectorImpl &DebugLoc, - const DbgValueHistoryMap::InstrRanges &Ranges) { +void DwarfDebug::buildLocationList(SmallVectorImpl &DebugLoc, + const DbgValueHistoryMap::Entries &Entries) { SmallVector OpenRanges; - for (auto I = Ranges.begin(), E = Ranges.end(); I != E; ++I) { - const MachineInstr *Begin = I->getBegin(); - const MachineInstr *End = I->getEnd(); + for (auto EI = Entries.begin(), EE = Entries.end(); EI != EE; ++EI) { + const MachineInstr *Begin = EI->getBegin(); + const MachineInstr *End = EI->getEnd(); assert(Begin->isDebugValue() && "Invalid History entry"); // Check if a variable is inaccessible in this range. @@ -1147,10 +1146,10 @@ DwarfDebug::buildLocationList(SmallVectorImpl &DebugLoc, const MCSymbol *EndLabel; if (End != nullptr) EndLabel = getLabelAfterInsn(End); - else if (std::next(I) == Ranges.end()) + else if (std::next(EI) == Entries.end()) EndLabel = Asm->getFunctionEnd(); else - EndLabel = getLabelBeforeInsn(std::next(I)->getBegin()); + EndLabel = getLabelBeforeInsn(std::next(EI)->getBegin()); assert(EndLabel && "Forgot label after instruction ending a range!"); LLVM_DEBUG(dbgs() << "DotDebugLoc: " << *Begin << "\n"); @@ -1275,8 +1274,8 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU, continue; // Instruction ranges, specifying where IV is accessible. - const auto &Ranges = I.second; - if (Ranges.empty()) + const auto &HistoryMapEntries = I.second; + if (HistoryMapEntries.empty()) continue; LexicalScope *Scope = nullptr; @@ -1293,12 +1292,12 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU, DbgVariable *RegVar = cast(createConcreteEntity(TheCU, *Scope, LocalVar, IV.second)); - const MachineInstr *MInsn = Ranges.front().getBegin(); + const MachineInstr *MInsn = HistoryMapEntries.front().getBegin(); assert(MInsn->isDebugValue() && "History must begin with debug value"); // Check if there is a single DBG_VALUE, valid throughout the var's scope. - if (Ranges.size() == 1 && - validThroughout(LScopes, MInsn, Ranges.front().getEnd())) { + if (HistoryMapEntries.size() == 1 && + validThroughout(LScopes, MInsn, HistoryMapEntries.front().getEnd())) { RegVar->initializeDbgValue(MInsn); continue; } @@ -1311,7 +1310,7 @@ void DwarfDebug::collectEntityInfo(DwarfCompileUnit &TheCU, // Build the location list for this variable. SmallVector Entries; - buildLocationList(Entries, Ranges); + buildLocationList(Entries, HistoryMapEntries); // If the variable has a DIBasicType, extract it. Basic types cannot have // unique identifiers, so don't bother resolving the type with the -- cgit v1.2.3