From 3e93e630aa97893cb758b9300aa18552d07b9539 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Thu, 29 May 2008 00:51:08 +0000 Subject: convert another operand loop to iterator formulation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51661 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ValueNumbering.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp index 1e4b306f62..98f04bd06e 100644 --- a/lib/Analysis/ValueNumbering.cpp +++ b/lib/Analysis/ValueNumbering.cpp @@ -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(I.getOperand(i)) || isa(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(*i) || isa(*i)) { + Op = *i; break; } -- cgit v1.2.3