From 7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 16 Apr 2010 23:37:20 +0000 Subject: Revert 101465, it broke internal OpenGL testing. Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/IPO/LowerSetJmp.cpp') diff --git a/llvm/lib/Transforms/IPO/LowerSetJmp.cpp b/llvm/lib/Transforms/IPO/LowerSetJmp.cpp index d1eaadd8a72..4d61e8345e0 100644 --- a/llvm/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/llvm/lib/Transforms/IPO/LowerSetJmp.cpp @@ -262,8 +262,8 @@ void LowerSetJmp::TransformLongJmpCall(CallInst* Inst) // char*. It returns "void", so it doesn't need to replace any of // Inst's uses and doesn't get a name. CastInst* CI = - new BitCastInst(Inst->getOperand(0), SBPTy, "LJBuf", Inst); - Value *Args[] = { CI, Inst->getOperand(1) }; + new BitCastInst(Inst->getOperand(1), SBPTy, "LJBuf", Inst); + Value *Args[] = { CI, Inst->getOperand(2) }; CallInst::Create(ThrowLongJmp, Args, Args + 2, "", Inst); SwitchValuePair& SVP = SwitchValMap[Inst->getParent()->getParent()]; @@ -378,7 +378,7 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst) const Type* SBPTy = Type::getInt8PtrTy(Inst->getContext()); CastInst* BufPtr = - new BitCastInst(Inst->getOperand(0), SBPTy, "SBJmpBuf", Inst); + new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst); Value *Args[] = { GetSetJmpMap(Func), BufPtr, ConstantInt::get(Type::getInt32Ty(Inst->getContext()), SetJmpIDMap[Func]++) @@ -473,7 +473,7 @@ void LowerSetJmp::visitCallInst(CallInst& CI) // Construct the new "invoke" instruction. TerminatorInst* Term = OldBB->getTerminator(); - std::vector Params(CI.op_begin(), CI.op_end() - 1); + std::vector Params(CI.op_begin() + 1, CI.op_end()); InvokeInst* II = InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func], Params.begin(), Params.end(), CI.getName(), Term); -- cgit v1.2.3