diff options
author | Gabor Greif <ggreif@gmail.com> | 2008-05-29 00:51:08 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2008-05-29 00:51:08 +0000 |
commit | fe46c578da97c57e18700ad250a67134ac95e7df (patch) | |
tree | 14c5f8b23a546f5e624d8f01283d6cb59c23740e /lib/Analysis | |
parent | aa25bb1320b4e94d2f90326ab73f2a42e5a4c3b7 (diff) | |
download | external_llvm-fe46c578da97c57e18700ad250a67134ac95e7df.zip external_llvm-fe46c578da97c57e18700ad250a67134ac95e7df.tar.gz external_llvm-fe46c578da97c57e18700ad250a67134ac95e7df.tar.bz2 |
convert another operand loop to iterator formulation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ValueNumbering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp index 1e4b306..98f04bd 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<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; } |