diff options
author | Lukas Wölfer <lukas.woelfer@rwth-aachen.de> | 2017-06-24 18:59:27 +0200 |
---|---|---|
committer | Dan Liew <delcypher@gmail.com> | 2017-08-04 11:52:03 +0100 |
commit | fff6485e2f3ec82b6cb31e1f5038adef09be7eed (patch) | |
tree | 91ccb200f906f9314f79e4bb11037b2948a641e2 /lib/Module | |
parent | a4ed54c2b8228a30785c11d7542427a1bd1f7292 (diff) | |
download | klee-fff6485e2f3ec82b6cb31e1f5038adef09be7eed.tar.gz |
Removed merging searchers
Diffstat (limited to 'lib/Module')
-rw-r--r-- | lib/Module/KModule.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 751776b9..bb34dcad 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -54,9 +54,6 @@ namespace { eSwitchTypeLLVM, eSwitchTypeInternal }; - - cl::list<std::string> - MergeAtExit("merge-at-exit"); cl::opt<bool> NoTruncateSourceLines("no-truncate-source-lines", @@ -91,7 +88,6 @@ namespace { KModule::KModule(Module *_module) : module(_module), targetData(new DataLayout(module)), - kleeMergeFn(0), infos(0), constantTable(0) { } @@ -206,53 +202,6 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, InterpreterHandler *ih) { LLVMContext &ctx = module->getContext(); - if (!MergeAtExit.empty()) { - Function *mergeFn = module->getFunction("klee_merge"); - if (!mergeFn) { - llvm::FunctionType *Ty = - FunctionType::get(Type::getVoidTy(ctx), std::vector<Type *>(), false); - mergeFn = Function::Create(Ty, GlobalVariable::ExternalLinkage, - "klee_merge", - module); - } - - for (cl::list<std::string>::iterator it = MergeAtExit.begin(), - ie = MergeAtExit.end(); it != ie; ++it) { - std::string &name = *it; - Function *f = module->getFunction(name); - if (!f) { - klee_error("cannot insert merge-at-exit for: %s (cannot find)", - name.c_str()); - } else if (f->isDeclaration()) { - klee_error("cannot insert merge-at-exit for: %s (external)", - name.c_str()); - } - - BasicBlock *exit = BasicBlock::Create(ctx, "exit", f); - PHINode *result = 0; - if (f->getReturnType() != Type::getVoidTy(ctx)) - result = PHINode::Create(f->getReturnType(), 0, "retval", exit); - CallInst::Create(mergeFn, "", exit); - ReturnInst::Create(ctx, result, exit); - - 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 = &*bbit; - if (bb != exit) { - Instruction *i = bbit->getTerminator(); - if (i->getOpcode()==Instruction::Ret) { - if (result) { - result->addIncoming(i->getOperand(0), bb); - } - i->eraseFromParent(); - BranchInst::Create(exit, bb); - } - } - } - } - } - // Inject checks prior to optimization... we also perform the // invariant transformations that we will end up doing later so that // optimize is seeing what is as close as possible to the final @@ -373,8 +322,6 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, delete f; } - kleeMergeFn = module->getFunction("klee_merge"); - /* Build shadow structures */ infos = new InstructionInfoTable(module); |