summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO/LowerSetJmp.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-06-24 14:13:36 +0000
committerGabor Greif <ggreif@gmail.com>2010-06-24 14:13:36 +0000
commitfef8c4eb54b585b5a299910ccf5a8479f4982243 (patch)
tree21ffdc98abcca2aeb62eec9d5317f3a7574d7e88 /lib/Transforms/IPO/LowerSetJmp.cpp
parentbcda85c74304ffada586a9c58ce9bcff93b69a86 (diff)
downloadexternal_llvm-fef8c4eb54b585b5a299910ccf5a8479f4982243.zip
external_llvm-fef8c4eb54b585b5a299910ccf5a8479f4982243.tar.gz
external_llvm-fef8c4eb54b585b5a299910ccf5a8479f4982243.tar.bz2
use ArgOperand API and CallSite for arg range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index 4d61e83..5312836 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -42,6 +42,7 @@
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
+#include "llvm/Support/CallSite.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/Transforms/Utils/Local.h"
@@ -262,8 +263,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(1), SBPTy, "LJBuf", Inst);
- Value *Args[] = { CI, Inst->getOperand(2) };
+ new BitCastInst(Inst->getArgOperand(0), SBPTy, "LJBuf", Inst);
+ Value *Args[] = { CI, Inst->getArgOperand(1) };
CallInst::Create(ThrowLongJmp, Args, Args + 2, "", Inst);
SwitchValuePair& SVP = SwitchValMap[Inst->getParent()->getParent()];
@@ -378,7 +379,7 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
const Type* SBPTy =
Type::getInt8PtrTy(Inst->getContext());
CastInst* BufPtr =
- new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst);
+ new BitCastInst(Inst->getArgOperand(0), SBPTy, "SBJmpBuf", Inst);
Value *Args[] = {
GetSetJmpMap(Func), BufPtr,
ConstantInt::get(Type::getInt32Ty(Inst->getContext()), SetJmpIDMap[Func]++)
@@ -473,7 +474,8 @@ void LowerSetJmp::visitCallInst(CallInst& CI)
// Construct the new "invoke" instruction.
TerminatorInst* Term = OldBB->getTerminator();
- std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
+ CallSite CS(&CI);
+ std::vector<Value*> Params(CS.arg_begin(), CS.arg_end());
InvokeInst* II =
InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
Params.begin(), Params.end(), CI.getName(), Term);