[llvm] r237918 - use range-based for-loops; NFCI
Sanjay Patel
spatel at rotateright.com
Thu May 21 10:43:26 PDT 2015
Author: spatel
Date: Thu May 21 12:43:26 2015
New Revision: 237918
URL: http://llvm.org/viewvc/llvm-project?rev=237918&view=rev
Log:
use range-based for-loops; NFCI
Modified:
llvm/trunk/lib/CodeGen/MachineCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=237918&r1=237917&r2=237918&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Thu May 21 12:43:26 2015
@@ -131,8 +131,7 @@ MachineCombiner::getDepth(SmallVectorImp
for (auto *InstrPtr : InsInstrs) { // for each Use
unsigned IDepth = 0;
DEBUG(dbgs() << "NEW INSTR "; InstrPtr->dump(); dbgs() << "\n";);
- for (unsigned i = 0, e = InstrPtr->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = InstrPtr->getOperand(i);
+ for (const MachineOperand &MO : InstrPtr->operands()) {
// Check for virtual register operand.
if (!(MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg())))
continue;
@@ -186,8 +185,7 @@ unsigned MachineCombiner::getLatency(Mac
// Check each definition in NewRoot and compute the latency
unsigned NewRootLatency = 0;
- for (unsigned i = 0, e = NewRoot->getNumOperands(); i != e; ++i) {
- const MachineOperand &MO = NewRoot->getOperand(i);
+ for (const MachineOperand &MO : NewRoot->operands()) {
// Check for virtual register operand.
if (!(MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg())))
continue;
More information about the llvm-commits
mailing list