diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-04-30 22:17:38 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-04-30 22:17:38 +0000 |
commit | 846781235d0c027702e2c528a6660ec14ca8edcd (patch) | |
tree | 30d199a2f92353f75a2999963407574de30c1343 /lib/CodeGen/LiveVariables.cpp | |
parent | fff0879df07ce0f449b00a9ed4b3d7732735bc4e (diff) | |
download | llvm-846781235d0c027702e2c528a6660ec14ca8edcd.tar.gz llvm-846781235d0c027702e2c528a6660ec14ca8edcd.tar.bz2 llvm-846781235d0c027702e2c528a6660ec14ca8edcd.tar.xz |
Convert more loops to range-based equivalents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index b372ce030f..758b2163ff 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -702,12 +702,14 @@ void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) { /// void LiveVariables::analyzePHINodes(const MachineFunction& Fn) { 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()) - PHIVarInfo[BBI->getOperand(i + 1).getMBB()->getNumber()] - .push_back(BBI->getOperand(i).getReg()); + for (const auto &BBI : MBB) { + if (!BBI.isPHI()) + break; + for (unsigned i = 1, e = BBI.getNumOperands(); i != e; i += 2) + if (BBI.getOperand(i).readsReg()) + PHIVarInfo[BBI.getOperand(i + 1).getMBB()->getNumber()] + .push_back(BBI.getOperand(i).getReg()); + } } bool LiveVariables::VarInfo::isLiveIn(const MachineBasicBlock &MBB, |