aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Module
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/KModule.cpp53
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);