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 | f74bde67353df69385c266cee3ba310fa0392d90 (patch) | |
tree | b01771b350e1da9149ee2d0e5c95208bd3b1ff8e /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | 3282af13d4f991235c43f5837252c546db24f7a8 (diff) | |
download | bcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.tar.gz bcm5719-llvm-f74bde67353df69385c266cee3ba310fa0392d90.zip |
Convert more loops to range-based equivalents
llvm-svn: 207714
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index b372ce030f9..758b2163ff4 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/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, |