aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoadValueNumbering.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-05-22 19:24:54 +0000
committerGabor Greif <ggreif@gmail.com>2008-05-22 19:24:54 +0000
commit785c6af9797fcf551feef70f2ecb5cd075b6e3c4 (patch)
tree9fc62621589ec52598b22869a38536e400638da7 /lib/Analysis/LoadValueNumbering.cpp
parentc36c0ab44bfff45e92a5d7d7df4f37e77c510784 (diff)
transform more loops to iterator form, detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index 0317ddbc91..2414d33863 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -158,10 +158,10 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
// global. In particular, we would prefer to have an argument or instruction
// operand to chase the def-use chains of.
Value *Op = CF;
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (isa<Argument>(CI->getOperand(i)) ||
- isa<Instruction>(CI->getOperand(i))) {
- Op = CI->getOperand(i);
+ for (User::op_iterator i = CI->op_begin() + 1, e = CI->op_end(); i != e; ++i)
+ if (isa<Argument>(*i) ||
+ isa<Instruction>(*i)) {
+ Op = *i;
break;
}
@@ -176,8 +176,9 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
C->getOperand(0) == CI->getOperand(0) &&
C->getParent()->getParent() == CIFunc && C != CI) {
bool AllOperandsEqual = true;
- for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i)
- if (C->getOperand(i) != CI->getOperand(i)) {
+ for (User::op_iterator i = CI->op_begin() + 1, j = C->op_begin() + 1,
+ e = CI->op_end(); i != e; ++i, ++j)
+ if (*j != *i) {
AllOperandsEqual = false;
break;
}