diff options
author | Cristian Cadar <cristic@cs.stanford.edu> | 2011-04-23 19:22:22 +0000 |
---|---|---|
committer | Cristian Cadar <cristic@cs.stanford.edu> | 2011-04-23 19:22:22 +0000 |
commit | 930ae7d06fc1d8cc3117397cb3fd168a0a1090b7 (patch) | |
tree | ac1ff2162b5ea6d51bbf6a1ac35f350a297234ac /lib/Module | |
parent | 2ec715a7e08724e54cd8c14904446d1b91b42121 (diff) | |
download | klee-930ae7d06fc1d8cc3117397cb3fd168a0a1090b7.tar.gz |
Patch by arrowdodger (http://keeda.stanford.edu/pipermail/klee-dev/2011-April/000617.html) for compiling KLEE with the latest LLVM changes. Tested against LLVM 2.7 and 2.8. The AsmAddresses test fails in 2.8 unless assertions are explicitely enabled (--enable-assertions).
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@130065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Module')
-rw-r--r-- | lib/Module/KModule.cpp | 10 | ||||
-rw-r--r-- | lib/Module/ModuleUtil.cpp | 4 | ||||
-rw-r--r-- | lib/Module/Optimize.cpp | 5 | ||||
-rw-r--r-- | lib/Module/RaiseAsm.cpp | 2 |
4 files changed, 19 insertions, 2 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 8842febb..0364127d 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -34,7 +34,11 @@ #if !(LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) #include "llvm/Support/raw_os_ostream.h" #endif +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) #include "llvm/System/Path.h" +#else +#include "llvm/Support/Path.h" +#endif #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Scalar.h" @@ -226,7 +230,11 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, BasicBlock *exit = BasicBlock::Create(getGlobalContext(), "exit", f); PHINode *result = 0; if (f->getReturnType() != Type::getVoidTy(getGlobalContext())) - result = PHINode::Create(f->getReturnType(), "retval", exit); +#if (LLVM_VERSION_MAJOR > 2) + result = PHINode::Create(f->getReturnType(), 0, "retval", exit); +#else + result = PHINode::Create(f->getReturnType(), "retval", exit); +#endif CallInst::Create(mergeFn, "", exit); ReturnInst::Create(getGlobalContext(), result, exit); diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index 935dfa62..11f2b2c5 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -25,7 +25,11 @@ #include "llvm/Support/InstIterator.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Analysis/ValueTracking.h" +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) #include "llvm/System/Path.h" +#else +#include "llvm/Support/Path.h" +#endif #include <map> #include <iostream> diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 1eadec26..633c21a1 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -15,13 +15,18 @@ // //===----------------------------------------------------------------------===// +#include "klee/Config/config.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Support/CommandLine.h" +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) #include "llvm/System/DynamicLibrary.h" +#else +#include "llvm/Support/DynamicLibrary.h" +#endif #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/IPO.h" diff --git a/lib/Module/RaiseAsm.cpp b/lib/Module/RaiseAsm.cpp index 11c89009..76a4f242 100644 --- a/lib/Module/RaiseAsm.cpp +++ b/lib/Module/RaiseAsm.cpp @@ -16,7 +16,7 @@ #endif #if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR >= 9) #include "llvm/Support/raw_ostream.h" -#include "llvm/System/Host.h" +#include "llvm/Support/Host.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetRegistry.h" #endif |