convert another operand loop to iterator formulation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51661 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif 2008-05-29 00:51:08 +00:00
parent 8370d38ade
commit 3e93e630aa

View File

@ -244,9 +244,9 @@ void BVNImpl::visitGetElementPtrInst(GetElementPtrInst &I) {
// Try to pick a local operand if possible instead of a constant or a global
// that might have a lot of uses.
for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i)
if (isa<Instruction>(I.getOperand(i)) || isa<Argument>(I.getOperand(i))) {
Op = I.getOperand(i);
for (User::op_iterator i = I.op_begin() + 1, e = I.op_end(); i != e; ++i)
if (isa<Instruction>(*i) || isa<Argument>(*i)) {
Op = *i;
break;
}