diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-07-20 18:36:48 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-07-20 18:36:48 +0000 |
commit | b640fcf217c848ad051977018c6dc8f3a5a37e1f (patch) | |
tree | 70c49e15714efdd13bfa096352701638c3b23db1 /lib/Core/ExternalDispatcher.cpp | |
parent | ed9ea0cf9dc856920afc6813fa1bea0ec7660ba1 (diff) | |
download | klee-b640fcf217c848ad051977018c6dc8f3a5a37e1f.tar.gz |
Updates for LLVM 3.0. Based on changes by arrowdodger, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@135598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core/ExternalDispatcher.cpp')
-rw-r--r-- | lib/Core/ExternalDispatcher.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index 5c03e42d..c876685e 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -209,7 +209,7 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in Value **args = new Value*[cs.arg_size()]; - std::vector<const Type*> nullary; + std::vector<LLVM_TYPE_Q Type*> nullary; Function *dispatcher = Function::Create(FunctionType::get(Type::getVoidTy(getGlobalContext()), nullary, false), @@ -229,7 +229,7 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in Instruction *argI64s = new LoadInst(argI64sp, "args", dBB); // Get the target function type. - const FunctionType *FTy = + LLVM_TYPE_Q FunctionType *FTy = cast<FunctionType>(cast<PointerType>(target->getType())->getElementType()); // Each argument will be passed by writing it into gTheArgsP[i]. @@ -239,8 +239,8 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in // Determine the type the argument will be passed as. This accomodates for // the corresponding code in Executor.cpp for handling calls to bitcasted // functions. - const Type *argTy = (i < FTy->getNumParams() ? FTy->getParamType(i) : - (*ai)->getType()); + LLVM_TYPE_Q Type *argTy = (i < FTy->getNumParams() ? FTy->getParamType(i) : + (*ai)->getType()); Instruction *argI64p = GetElementPtrInst::Create(argI64s, ConstantInt::get(Type::getInt32Ty(getGlobalContext()), @@ -258,7 +258,13 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in Constant *dispatchTarget = dispatchModule->getOrInsertFunction(target->getName(), FTy, target->getAttributes()); +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0) + Instruction *result = CallInst::Create(dispatchTarget, + llvm::ArrayRef<Value *>(args, args+i), + "", dBB); +#else Instruction *result = CallInst::Create(dispatchTarget, args, args+i, "", dBB); +#endif if (result->getType() != Type::getVoidTy(getGlobalContext())) { Instruction *resp = new BitCastInst(argI64s, PointerType::getUnqual(result->getType()), |