summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Stenberg <david.stenberg@ericsson.com>2019-04-10 09:07:43 +0000
committerDavid Stenberg <david.stenberg@ericsson.com>2019-04-10 09:07:43 +0000
commit6feef56d1bdb471d0415afedebfbe49c91ca1dce (patch)
treeda12c8ccca6014c4463a7d8e6699cfedc0e39766 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent3739979c2031ebcf0ed40d30d549cf82bb1a122c (diff)
downloadbcm5719-llvm-6feef56d1bdb471d0415afedebfbe49c91ca1dce.tar.gz
bcm5719-llvm-6feef56d1bdb471d0415afedebfbe49c91ca1dce.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp27
1 files changed, 13 insertions, 14 deletions
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<DebugLocEntry> &DebugLoc,
- const DbgValueHistoryMap::InstrRanges &Ranges) {
+void DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
+ const DbgValueHistoryMap::Entries &Entries) {
SmallVector<DebugLocEntry::Value, 4> 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<DebugLocEntry> &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<DbgVariable>(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<DebugLocEntry, 8> 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
OpenPOWER on IntegriCloud