diff options
| author | Jiri Slaby <jirislaby@gmail.com> | 2017-06-07 14:30:54 +0200 |
|---|---|---|
| committer | Jiri Slaby <jirislaby@gmail.com> | 2017-06-15 14:42:45 +0200 |
| commit | c9c90a0ecdce10172fd5318aea60a9ff4057679f (patch) | |
| tree | 9bb4b6d1ca326480776340312c5454ee78a2a1a5 /lib/Module/KModule.cpp | |
| parent | 6204a1faed8f6ed15318be8da3e8e4b5e2f2a4ac (diff) | |
| download | klee-c9c90a0ecdce10172fd5318aea60a9ff4057679f.tar.gz | |
llvm: get rid of static_casts from iterators
In commit b7a6aec4eeb4 (convert iterators using static_cast), I switched all implicit casts to static_cast. It turned out that llvm 4.0 banned casting via static_cast. See e.g. 1e2bc42eb988 in the llvm repo what they do. So similarly to the above commit, change all the casts of iterators to "&*" which is what they do in LLVM. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Diffstat (limited to 'lib/Module/KModule.cpp')
| -rw-r--r-- | lib/Module/KModule.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 6438707a..4acda09a 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -196,7 +196,7 @@ static void injectStaticConstructorsAndDestructors(Module *m) { if (ctors) CallInst::Create(getStubFunctionForCtorList(m, ctors, "klee.ctor_stub"), - "", static_cast<Instruction *>(mainFn->begin()->begin())); + "", &*(mainFn->begin()->begin())); if (dtors) { Function *dtorStub = getStubFunctionForCtorList(m, dtors, "klee.dtor_stub"); for (Function::iterator it = mainFn->begin(), ie = mainFn->end(); @@ -286,7 +286,7 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, llvm::errs() << "KLEE: adding klee_merge at exit of: " << name << "\n"; for (llvm::Function::iterator bbit = f->begin(), bbie = f->end(); bbit != bbie; ++bbit) { - BasicBlock *bb = static_cast<BasicBlock *>(bbit); + BasicBlock *bb = &*bbit; if (bb != exit) { Instruction *i = bbit->getTerminator(); if (i->getOpcode()==Instruction::Ret) { @@ -451,7 +451,7 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, if (it->isDeclaration()) continue; - Function *fn = static_cast<Function *>(it); + Function *fn = &*it; KFunction *kf = new KFunction(fn, this); for (unsigned i=0; i<kf->numInstructions; ++i) { @@ -542,7 +542,7 @@ KFunction::KFunction(llvm::Function *_function, trackCoverage(true) { for (llvm::Function::iterator bbit = function->begin(), bbie = function->end(); bbit != bbie; ++bbit) { - BasicBlock *bb = static_cast<BasicBlock *>(bbit); + BasicBlock *bb = &*bbit; basicBlockEntry[bb] = numInstructions; numInstructions += bb->size(); } @@ -557,7 +557,7 @@ KFunction::KFunction(llvm::Function *_function, bbie = function->end(); bbit != bbie; ++bbit) { for (llvm::BasicBlock::iterator it = bbit->begin(), ie = bbit->end(); it != ie; ++it) - registerMap[static_cast<Instruction *>(it)] = rnum++; + registerMap[&*it] = rnum++; } numRegisters = rnum; @@ -577,7 +577,7 @@ KFunction::KFunction(llvm::Function *_function, ki = new KInstruction(); break; } - Instruction *inst = static_cast<Instruction *>(it); + Instruction *inst = &*it; ki->inst = inst; ki->dest = registerMap[inst]; |
