diff options
author | Owen Anderson <resistor@mac.com> | 2014-03-17 19:36:09 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2014-03-17 19:36:09 +0000 |
commit | 92fca73d521758012e0e425eac33bb77e888112e (patch) | |
tree | fa7800b649af496eebf17dd4d279ae9a1671c50e /lib/CodeGen/TailDuplication.cpp | |
parent | 7ad87e4d3b93f2c8f3c8cd298474a98c3a1e3ba4 (diff) | |
download | llvm-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/TailDuplication.cpp')
-rw-r--r-- | lib/CodeGen/TailDuplication.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp index df28c3938a..40ce2b6cbb 100644 --- a/lib/CodeGen/TailDuplication.cpp +++ b/lib/CodeGen/TailDuplication.cpp @@ -338,12 +338,10 @@ bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) { static bool isDefLiveOut(unsigned Reg, MachineBasicBlock *BB, const MachineRegisterInfo *MRI) { - for (MachineRegisterInfo::use_instr_iterator UI = MRI->use_instr_begin(Reg), - UE = MRI->use_instr_end(); UI != UE; ++UI) { - MachineInstr *UseMI = &*UI; - if (UseMI->isDebugValue()) + for (MachineInstr &UseMI : MRI->use_instructions(Reg)) { + if (UseMI.isDebugValue()) continue; - if (UseMI->getParent() != BB) + if (UseMI.getParent() != BB) return true; } return false; |