diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index e28478c256c..aa63ca72ccb 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1717,7 +1717,8 @@ static bool AddressIsTaken(const GlobalValue *GV) { return true; // Storing addr of GV. } else if (isa<InvokeInst>(U) || isa<CallInst>(U)) { // Make sure we are calling the function, not passing the address. - if (UI.getOperandNo() != 0) + CallSite CS((Instruction*)U); + if (!CS.isCallee(UI)) return true; } else if (const LoadInst *LI = dyn_cast<LoadInst>(U)) { if (LI->isVolatile()) diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 738c5e8d13d..b621e8d8aa6 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -79,7 +79,7 @@ static void ChangeToUnreachable(Instruction *I) { /// ChangeToCall - Convert the specified invoke into a normal call. static void ChangeToCall(InvokeInst *II) { BasicBlock *BB = II->getParent(); - SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end()); + SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3); CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args.begin(), Args.end(), "", II); NewCall->takeName(II); |