diff options
author | Andrea Mattavelli <andreamattavelli@users.noreply.github.com> | 2017-07-18 17:39:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 17:39:21 +0100 |
commit | 5e4f0b7c79d57b9a9908f6293a5936fa54e511e9 (patch) | |
tree | 8429e4cb0c60bec43621c4971626fea397ea108f /tools | |
parent | 64f367ea9db4739b70414cba002bf25d28db6242 (diff) | |
parent | c9c90a0ecdce10172fd5318aea60a9ff4057679f (diff) | |
download | klee-5e4f0b7c79d57b9a9908f6293a5936fa54e511e9.tar.gz |
Merge pull request #672 from jirislaby/llvm40_static_casts
llvm: get rid of static_casts from iterators
Diffstat (limited to 'tools')
-rw-r--r-- | tools/klee/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index 3662cbee..d04963e1 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -668,10 +668,10 @@ static int initEnv(Module *mainModule) { klee_error("Cannot handle ""--posix-runtime"" when main() has less than two arguments.\n"); } - Instruction *firstInst = static_cast<Instruction *>(mainFn->begin()->begin()); + Instruction *firstInst = &*(mainFn->begin()->begin()); - Value *oldArgc = static_cast<Argument *>(mainFn->arg_begin()); - Value *oldArgv = static_cast<Argument *>(++mainFn->arg_begin()); + Value *oldArgc = &*(mainFn->arg_begin()); + Value *oldArgv = &*(++mainFn->arg_begin()); AllocaInst* argcPtr = new AllocaInst(oldArgc->getType(), "argcPtr", firstInst); @@ -1078,7 +1078,7 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule, StringRef libDir) // naming conflict. for (Module::iterator fi = mainModule->begin(), fe = mainModule->end(); fi != fe; ++fi) { - Function *f = static_cast<Function *>(fi); + Function *f = &*fi; const std::string &name = f->getName(); if (name[0]=='\01') { unsigned size = name.size(); @@ -1137,8 +1137,8 @@ static llvm::Module *linkWithUclibc(llvm::Module *mainModule, StringRef libDir) std::vector<llvm::Value*> args; args.push_back(llvm::ConstantExpr::getBitCast(userMainFn, ft->getParamType(0))); - args.push_back(static_cast<Argument *>(stub->arg_begin())); // argc - args.push_back(static_cast<Argument *>(++stub->arg_begin())); // argv + args.push_back(&*(stub->arg_begin())); // argc + args.push_back(&*(++stub->arg_begin())); // argv args.push_back(Constant::getNullValue(ft->getParamType(3))); // app_init args.push_back(Constant::getNullValue(ft->getParamType(4))); // app_fini args.push_back(Constant::getNullValue(ft->getParamType(5))); // rtld_fini |