diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-30 18:29:51 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-30 18:29:51 +0000 |
commit | 4aef7270c975ed62788ce5956a1763101113bc6f (patch) | |
tree | b5b6df3dc98780fc2a13354ac567cac966a0f657 /lib/CodeGen/LiveVariables.cpp | |
parent | 78ecea93a30e5fe05277f11b07a2d32a7c68e31d (diff) | |
download | llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.gz llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.bz2 llvm-4aef7270c975ed62788ce5956a1763101113bc6f.tar.xz |
Convert several loops over MachineFunction basic blocks to range-based loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index ed31384534..b372ce030f 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -701,9 +701,8 @@ void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) { /// which is used in a PHI node. We map that to the BB the vreg is coming from. /// void LiveVariables::analyzePHINodes(const MachineFunction& Fn) { - for (MachineFunction::const_iterator I = Fn.begin(), E = Fn.end(); - I != E; ++I) - for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end(); + for (const auto &MBB : Fn) + for (MachineBasicBlock::const_iterator BBI = MBB.begin(), BBE = MBB.end(); BBI != BBE && BBI->isPHI(); ++BBI) for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i += 2) if (BBI->getOperand(i).readsReg()) |