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 /tools | |
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 'tools')
-rw-r--r-- | tools/klee/main.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 12f90f2a..16cc6283 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -637,8 +637,13 @@ static int initEnv(Module *mainModule) { std::vector<Value*> args; args.push_back(argcPtr); args.push_back(argvPtr); +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0) + Instruction* initEnvCall = CallInst::Create(initEnvFn, args, + "", firstInst); +#else Instruction* initEnvCall = CallInst::Create(initEnvFn, args.begin(), args.end(), "", firstInst); +#endif Value *argc = new LoadInst(argcPtr, "newArgc", firstInst); Value *argv = new LoadInst(argvPtr, "newArgv", firstInst); @@ -937,12 +942,12 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule) { // force import of __uClibc_main mainModule->getOrInsertFunction("__uClibc_main", FunctionType::get(Type::getVoidTy(getGlobalContext()), - std::vector<const Type*>(), + std::vector<LLVM_TYPE_Q Type*>(), true)); // force various imports if (WithPOSIXRuntime) { - const llvm::Type *i8Ty = Type::getInt8Ty(getGlobalContext()); + LLVM_TYPE_Q llvm::Type *i8Ty = Type::getInt8Ty(getGlobalContext()); mainModule->getOrInsertFunction("realpath", PointerType::getUnqual(i8Ty), PointerType::getUnqual(i8Ty), @@ -1045,7 +1050,7 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule) { const FunctionType *ft = uclibcMainFn->getFunctionType(); assert(ft->getNumParams() == 7); - std::vector<const Type*> fArgs; + std::vector<LLVM_TYPE_Q Type*> fArgs; fArgs.push_back(ft->getParamType(1)); // argc fArgs.push_back(ft->getParamType(2)); // argv Function *stub = Function::Create(FunctionType::get(Type::getInt32Ty(getGlobalContext()), fArgs, false), @@ -1063,7 +1068,11 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule) { args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini args.push_back(Constant::getNullValue(ft->getParamType(6))); // stack_end +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0) + CallInst::Create(uclibcMainFn, args, "", bb); +#else CallInst::Create(uclibcMainFn, args.begin(), args.end(), "", bb); +#endif new UnreachableInst(getGlobalContext(), bb); |