about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-12 20:42:31 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-12 20:42:31 +0000
commit40d4cc09c873518519723244b38cc740ceda2bc8 (patch)
tree1e5918852817b13d7c146e28654c52d9ffa18422
parent1277acf6d1de3208a458d76710a94e63f9d3bf94 (diff)
downloadklee-40d4cc09c873518519723244b38cc740ceda2bc8.tar.gz
Update for LLVM API changes.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@75427 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Core/ExternalDispatcher.cpp8
-rw-r--r--lib/Core/ExternalDispatcher.h3
-rw-r--r--lib/Module/LowerSwitch.cpp8
-rw-r--r--tools/klee/main.cpp2
4 files changed, 8 insertions, 13 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
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index a6cc7aa8..7fff773c 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -1129,7 +1129,7 @@ int main(int argc, char **argv, char **envp) {
   std::string ErrorMsg;
   ModuleProvider *MP = 0;
   if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile, &ErrorMsg)) {
-    MP = getBitcodeModuleProvider(Buffer, &ErrorMsg);
+    MP = getBitcodeModuleProvider(Buffer, getGlobalContext(), &ErrorMsg);
     if (!MP) delete Buffer;
   }