summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-30 22:17:38 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-30 22:17:38 +0000
commitf74bde67353df69385c266cee3ba310fa0392d90 (patch)
treeb01771b350e1da9149ee2d0e5c95208bd3b1ff8e /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent3282af13d4f991235c43f5837252c546db24f7a8 (diff)
downloadbcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.tar.gz
bcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.zip
Convert more loops to range-based equivalents
llvm-svn: 207714
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8de084abff1..d3309c1e6e8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1441,23 +1441,21 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
// Collect user variables, find the end of the prologue.
for (const auto &MBB : *MF) {
- for (MachineBasicBlock::const_iterator II = MBB.begin(), IE = MBB.end();
- II != IE; ++II) {
- const MachineInstr *MI = II;
- if (MI->isDebugValue()) {
- assert(MI->getNumOperands() > 1 && "Invalid machine instruction!");
+ for (const auto &MI : MBB) {
+ if (MI.isDebugValue()) {
+ assert(MI.getNumOperands() > 1 && "Invalid machine instruction!");
// Keep track of user variables in order of appearance. Store the set
// of variables we've already seen as a set of keys in DbgValues.
- const MDNode *Var = MI->getDebugVariable();
+ const MDNode *Var = MI.getDebugVariable();
auto IterPair = DbgValues.insert(
std::make_pair(Var, SmallVector<const MachineInstr *, 4>()));
if (IterPair.second)
UserVariables.push_back(Var);
- } else if (!MI->getFlag(MachineInstr::FrameSetup) &&
- PrologEndLoc.isUnknown() && !MI->getDebugLoc().isUnknown()) {
+ } else if (!MI.getFlag(MachineInstr::FrameSetup) &&
+ PrologEndLoc.isUnknown() && !MI.getDebugLoc().isUnknown()) {
// First known non-DBG_VALUE and non-frame setup location marks
// the beginning of the function body.
- PrologEndLoc = MI->getDebugLoc();
+ PrologEndLoc = MI.getDebugLoc();
}
}
}
OpenPOWER on IntegriCloud