about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-15 20:37:05 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-15 20:37:05 +0000
commit592f0bcd15cda958270ae7224b5bbf3e2f4201a5 (patch)
tree2861f471fd305d06dcf26ddde9ff1592761d1843
parentd786ba65b69c57fec0804d4a529682844ac2d411 (diff)
downloadklee-592f0bcd15cda958270ae7224b5bbf3e2f4201a5.tar.gz
[llvm up] Update for LLVM TOT changes.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@75826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Core/Executor.cpp5
-rw-r--r--lib/Core/ExternalDispatcher.cpp4
-rw-r--r--tools/klee/main.cpp6
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index a921511e..67459650 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -1378,9 +1378,10 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
     if (ConstantExpr *CE = dyn_cast<ConstantExpr>(cond)) {
       // Somewhat gross to create these all the time, but fine till we
       // switch to an internal rep.
+      const llvm::IntegerType *Ty = 
+        cast<IntegerType>(si->getCondition()->getType());
       ConstantInt *ci = 
-        ConstantInt::get(cast<IntegerType>(si->getCondition()->getType()),
-                         CE->getZExtValue());
+        getGlobalContext().getConstantInt(Ty, CE->getZExtValue());
       unsigned index = si->findCaseValue(ci);
       transferToBasicBlock(si->getSuccessor(index), si->getParent(), state);
     } else {
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 80bff188..a330a7cd 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -198,7 +198,7 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in
 
   BasicBlock *dBB = BasicBlock::Create("entry", dispatcher);
 
-  Instruction *argI64sp = new IntToPtrInst(ConstantInt::get(Type::Int64Ty, (long) (void*) &gTheArgsP),
+  Instruction *argI64sp = new IntToPtrInst(getGlobalContext().getConstantInt(Type::Int64Ty, (long) (void*) &gTheArgsP),
 					   PointerType::getUnqual(PointerType::getUnqual(Type::Int64Ty)),
 					   "argsp",
 					   dBB);
@@ -207,7 +207,7 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in
   unsigned i = 0;
   for (CallSite::arg_iterator ai = cs.arg_begin(), ae = cs.arg_end();
        ai!=ae; ++ai, ++i) {
-    Value *index = ConstantInt::get(Type::Int32Ty, i+1);
+    Value *index = getGlobalContext().getConstantInt(Type::Int32Ty, i+1);
 
     Instruction *argI64p = GetElementPtrInst::Create(argI64s, index, "", dBB);
     Instruction *argp = new BitCastInst(argI64p, 
diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp
index 58e7eecc..af8b829d 100644
--- a/tools/klee/main.cpp
+++ b/tools/klee/main.cpp
@@ -603,8 +603,10 @@ static int initEnv(Module *mainModule) {
   Value* oldArgc = mainFn->arg_begin();
   Value* oldArgv = ++mainFn->arg_begin();
   
-  AllocaInst* argcPtr = new AllocaInst(oldArgc->getType(), "argcPtr", firstInst);
-  AllocaInst* argvPtr = new AllocaInst(oldArgv->getType(), "argvPtr", firstInst);
+  AllocaInst* argcPtr = new AllocaInst(getGlobalContext(), oldArgc->getType(), 
+                                       "argcPtr", firstInst);
+  AllocaInst* argvPtr = new AllocaInst(getGlobalContext(), oldArgv->getType(), 
+                                       "argvPtr", firstInst);
 
   /* Insert void klee_init_env(int* argc, char*** argv) */
   std::vector<const Type*> params;