aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-16 01:16:20 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-16 01:16:20 +0000
commit403e9694f9e284cb145bb6f40b1b7c9f70a125f1 (patch)
tree1b7aaa95239227c67473d032a9dfae5b48c122d2 /llvm/lib/Analysis/ConstantFolding.cpp
parent393e08536dbe9ca338c6d15a97731737c174ce7b (diff)
downloadllvm-403e9694f9e284cb145bb6f40b1b7c9f70a125f1.zip
llvm-403e9694f9e284cb145bb6f40b1b7c9f70a125f1.tar.gz
llvm-403e9694f9e284cb145bb6f40b1b7c9f70a125f1.tar.bz2
back out r101423 and r101397, they break llvm-gcc self-host on darwin10
llvm-svn: 101434
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 0723443..37cda02 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -772,9 +772,9 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
case Instruction::ICmp:
case Instruction::FCmp: assert(0 && "Invalid for compares");
case Instruction::Call:
- if (Function *F = dyn_cast<Function>(Ops[NumOps - 1]))
+ if (Function *F = dyn_cast<Function>(Ops[0]))
if (canConstantFoldCallTo(F))
- return ConstantFoldCall(F, Ops, NumOps - 1);
+ return ConstantFoldCall(F, Ops+1, NumOps-1);
return 0;
case Instruction::PtrToInt:
// If the input is a inttoptr, eliminate the pair. This requires knowing