aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/RegAllocBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBase.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocBase.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index 648036e..fb18f5a 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -116,11 +116,8 @@ void RegAllocBase::allocatePhysRegs() {
// selectOrSplit failed to find a register!
// Probably caused by an inline asm.
MachineInstr *MI = nullptr;
- for (MachineRegisterInfo::reg_instr_iterator
- I = MRI->reg_instr_begin(VirtReg->reg()),
- E = MRI->reg_instr_end();
- I != E;) {
- MI = &*(I++);
+ for (MachineInstr &MIR : MRI->reg_instructions(VirtReg->reg())) {
+ MI = &MIR;
if (MI->isInlineAsm())
break;
}