diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Core/ExternalDispatcher.cpp | 8 | ||||
-rw-r--r-- | lib/Core/ExternalDispatcher.h | 3 | ||||
-rw-r--r-- | lib/Module/LowerSwitch.cpp | 8 |
3 files changed, 7 insertions, 12 deletions
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index 3486a757..80bff188 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -52,7 +52,7 @@ void *ExternalDispatcher::resolveSymbol(const std::string &name) { if (str[0] == 1) // asm specifier, skipped ++str; - void *addr = dl_symbols.SearchForAddressOfSymbol(str); + void *addr = sys::DynamicLibrary::SearchForAddressOfSymbol(str); if (addr) return addr; @@ -60,14 +60,14 @@ void *ExternalDispatcher::resolveSymbol(const std::string &name) { // without the underscore. I (DWD) don't know why. if (name[0] == 1 && str[0]=='_') { ++str; - addr = dl_symbols.SearchForAddressOfSymbol(str); + addr = sys::DynamicLibrary::SearchForAddressOfSymbol(str); } return addr; } ExternalDispatcher::ExternalDispatcher() { - dispatchModule = new Module("ExternalDispatcher"); + dispatchModule = new Module("ExternalDispatcher", getGlobalContext()); ExistingModuleProvider* MP = new ExistingModuleProvider(dispatchModule); std::string error; @@ -85,7 +85,7 @@ ExternalDispatcher::ExternalDispatcher() { if (executionEngine) { // Make sure we can resolve symbols in the program as well. The zero arg // to the function tells DynamicLibrary to load the program, not a library. - dl_symbols.LoadLibraryPermanently(0); + sys::DynamicLibrary::LoadLibraryPermanently(0); } #ifdef WINDOWS diff --git a/lib/Core/ExternalDispatcher.h b/lib/Core/ExternalDispatcher.h index fc8f80f4..c173df73 100644 --- a/lib/Core/ExternalDispatcher.h +++ b/lib/Core/ExternalDispatcher.h @@ -11,7 +11,7 @@ #define KLEE_EXTERNALDISPATCHER_H #include <map> -#include "llvm/System/DynamicLibrary.h" +#include <string> namespace llvm { class ExecutionEngine; @@ -28,7 +28,6 @@ namespace klee { dispatchers_ty dispatchers; llvm::Module *dispatchModule; llvm::ExecutionEngine *executionEngine; - llvm::sys::DynamicLibrary dl_symbols; std::map<std::string, void*> preboundFunctions; llvm::Function *createDispatcher(llvm::Function *f, llvm::Instruction *i); diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp index a1b887f3..a2033eae 100644 --- a/lib/Module/LowerSwitch.cpp +++ b/lib/Module/LowerSwitch.cpp @@ -64,12 +64,8 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr end, Function::iterator FI = origBlock; F->getBasicBlockList().insert(++FI, newBlock); - ICmpInst *cmpInst = new ICmpInst(ICmpInst::ICMP_EQ, - value, - it->value, - "Case Comparison"); - - newBlock->getInstList().push_back(cmpInst); + ICmpInst *cmpInst = + new ICmpInst(*newBlock, ICmpInst::ICMP_EQ, value, it->value, "case.cmp"); BranchInst::Create(it->block, curHead, cmpInst, newBlock); // If there were any PHI nodes in this successor, rewrite one entry |