From b36376efcb0f75963a0236447cc7dffba14f5ada Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 17 Mar 2014 19:36:09 +0000 Subject: Switch a number of loops in lib/CodeGen over to range-based for-loops, now that the MachineRegisterInfo iterators are compatible with it. llvm-svn: 204075 --- llvm/lib/CodeGen/LiveRangeEdit.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp') diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index c7372592854..891eaab1a59 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -167,10 +167,8 @@ 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; - MachineInstr *MI = I->getParent(); + for (MachineOperand &MO : MRI.reg_nodbg_operands(LI->reg)) { + MachineInstr *MI = MO.getParent(); if (MO.isDef()) { if (DefMI && DefMI != MI) return false; -- cgit v1.2.3