aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorDavid Stenberg <david.stenberg@ericsson.com>2019-04-10 09:07:32 +0000
committerDavid Stenberg <david.stenberg@ericsson.com>2019-04-10 09:07:32 +0000
commit3739979c2031ebcf0ed40d30d549cf82bb1a122c (patch)
tree7e37c9a2fec093fe136059a9b71c368b16b59b63 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parent83443c9a9ec76e55a052854bfacdbb40d2eb6a72 (diff)
downloadllvm-3739979c2031ebcf0ed40d30d549cf82bb1a122c.zip
llvm-3739979c2031ebcf0ed40d30d549cf82bb1a122c.tar.gz
llvm-3739979c2031ebcf0ed40d30d549cf82bb1a122c.tar.bz2
[DebugInfo] Make InstrRange into a class, NFC
Summary: Replace use of std::pair by creating a class for the debug value instruction ranges instead. This is a preparatory refactoring for improving handling of clobbered fragments. In an upcoming commit the Begin pointer will become a PointerIntPair, so it will be cleaner to have a getter for that. Reviewers: aprantl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59938 llvm-svn: 358059
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 0680d20..7a43542 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -228,31 +228,32 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
// doing that violates the ranges that are calculated in the history map.
// However, we currently do not emit debug values for constant arguments
// directly at the start of the function, so this code is still useful.
- const DILocalVariable *DIVar = Ranges.front().first->getDebugVariable();
+ const DILocalVariable *DIVar =
+ Ranges.front().getBegin()->getDebugVariable();
if (DIVar->isParameter() &&
getDISubprogram(DIVar->getScope())->describes(&MF->getFunction())) {
- if (!IsDescribedByReg(Ranges.front().first))
- LabelsBeforeInsn[Ranges.front().first] = Asm->getFunctionBegin();
- if (Ranges.front().first->getDebugExpression()->isFragment()) {
+ if (!IsDescribedByReg(Ranges.front().getBegin()))
+ LabelsBeforeInsn[Ranges.front().getBegin()] = Asm->getFunctionBegin();
+ if (Ranges.front().getBegin()->getDebugExpression()->isFragment()) {
// Mark all non-overlapping initial fragments.
for (auto I = Ranges.begin(); I != Ranges.end(); ++I) {
- const DIExpression *Fragment = I->first->getDebugExpression();
+ const DIExpression *Fragment = I->getBegin()->getDebugExpression();
if (std::any_of(Ranges.begin(), I,
[&](DbgValueHistoryMap::InstrRange Pred) {
return Fragment->fragmentsOverlap(
- Pred.first->getDebugExpression());
+ Pred.getBegin()->getDebugExpression());
}))
break;
- if (!IsDescribedByReg(I->first))
- LabelsBeforeInsn[I->first] = Asm->getFunctionBegin();
+ if (!IsDescribedByReg(I->getBegin()))
+ LabelsBeforeInsn[I->getBegin()] = Asm->getFunctionBegin();
}
}
}
for (const auto &Range : Ranges) {
- requestLabelBeforeInsn(Range.first);
- if (Range.second)
- requestLabelAfterInsn(Range.second);
+ requestLabelBeforeInsn(Range.getBegin());
+ if (Range.getEnd())
+ requestLabelAfterInsn(Range.getEnd());
}
}