Debug info: Factor the retrieving of the DIVariable from a MachineInstr
[oota-llvm.git] / lib / CodeGen / LiveRangeEdit.cpp
index cb70c43bf551784b74f29e2aaffccc045419eacc..891eaab1a597ff7d5334f6b9b02b5d4763364da8 100644 (file)
@@ -167,9 +167,7 @@ bool LiveRangeEdit::foldAsLoad(LiveInterval *LI,
   MachineInstr *DefMI = 0, *UseMI = 0;
 
   // Check that there is a single def and a single use.
-  for (MachineRegisterInfo::reg_nodbg_iterator I = MRI.reg_nodbg_begin(LI->reg),
-       E = MRI.reg_nodbg_end(); I != E; ++I) {
-    MachineOperand &MO = I.getOperand();
+  for (MachineOperand &MO : MRI.reg_nodbg_operands(LI->reg)) {
     MachineInstr *MI = MO.getParent();
     if (MO.isDef()) {
       if (DefMI && DefMI != MI)