index 8de084abff1e9ad51624fdae6587d6ad009d9b89..d3309c1e6e8aa44b5d1bd8ce0ef8e868c796d1d5 100644 (file)
// 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();
}
}
}