summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2014-03-17 19:36:09 +0000
committerOwen Anderson <resistor@mac.com>2014-03-17 19:36:09 +0000
commit92fca73d521758012e0e425eac33bb77e888112e (patch)
treefa7800b649af496eebf17dd4d279ae9a1671c50e /lib/CodeGen/LiveRangeEdit.cpp
parent7ad87e4d3b93f2c8f3c8cd298474a98c3a1e3ba4 (diff)
downloadllvm-92fca73d521758012e0e425eac33bb77e888112e.tar.gz
llvm-92fca73d521758012e0e425eac33bb77e888112e.tar.bz2
llvm-92fca73d521758012e0e425eac33bb77e888112e.tar.xz
Switch a number of loops in lib/CodeGen over to range-based for-loops, now that
the MachineRegisterInfo iterators are compatible with it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--lib/CodeGen/LiveRangeEdit.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp
index c737259285..891eaab1a5 100644
--- a/lib/CodeGen/LiveRangeEdit.cpp
+++ b/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;