aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorAndrea Mattavelli <andreamattavelli@users.noreply.github.com>2017-07-24 16:17:04 +0200
committerGitHub <noreply@github.com>2017-07-24 16:17:04 +0200
commit769bd87658d3445af6770cadb1fe50edea833d15 (patch)
tree685a818fd4a7336232168fde9b86eb229b23e730 /include
parent9fb2f5666d5f8c7c2f335fc8408883a0cf958964 (diff)
parent72ea2c66dd4da5971914dce334138f2d5f8db19a (diff)
downloadklee-769bd87658d3445af6770cadb1fe50edea833d15.tar.gz
Merge pull request #713 from MartinNowack/remove_llvm_29_33
Remove support for LLVM < 3.4
Diffstat (limited to 'include')
-rw-r--r--include/klee/Config/Version.h6
-rw-r--r--include/klee/Expr.h3
-rw-r--r--include/klee/Internal/Module/KModule.h8
-rw-r--r--include/klee/Internal/Support/ModuleUtil.h6
-rw-r--r--include/klee/util/GetElementPtrTypeIterator.h51
5 files changed, 18 insertions, 56 deletions
diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
index c1fdbb97..ccf54ae1 100644
--- a/include/klee/Config/Version.h
+++ b/include/klee/Config/Version.h
@@ -15,12 +15,6 @@
#define LLVM_VERSION(major, minor) (((major) << 8) | (minor))
#define LLVM_VERSION_CODE LLVM_VERSION(LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR)
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0)
-# define LLVM_TYPE_Q
-#else
-# define LLVM_TYPE_Q const
-#endif
-
#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
# define KLEE_LLVM_CL_VAL_END
#else
diff --git a/include/klee/Expr.h b/include/klee/Expr.h
index 6c5351df..212053b4 100644
--- a/include/klee/Expr.h
+++ b/include/klee/Expr.h
@@ -332,13 +332,10 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Expr &e) {
return os;
}
-// XXX the following macro is to work around the ExprTest unit test compile error
-#ifndef LLVM_29_UNITTEST
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Expr::Kind kind) {
Expr::printKind(os, kind);
return os;
}
-#endif
inline std::stringstream &operator<<(std::stringstream &os, const Expr &e) {
std::string str;
diff --git a/include/klee/Internal/Module/KModule.h b/include/klee/Internal/Module/KModule.h
index 76db4694..f0f20394 100644
--- a/include/klee/Internal/Module/KModule.h
+++ b/include/klee/Internal/Module/KModule.h
@@ -23,11 +23,7 @@ namespace llvm {
class Function;
class Instruction;
class Module;
-#if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
- class TargetData;
-#else
class DataLayout;
-#endif
}
namespace klee {
@@ -85,11 +81,7 @@ namespace klee {
class KModule {
public:
llvm::Module *module;
-#if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
- llvm::TargetData *targetData;
-#else
llvm::DataLayout *targetData;
-#endif
// Some useful functions to know the address of
llvm::Function *kleeMergeFn;
diff --git a/include/klee/Internal/Support/ModuleUtil.h b/include/klee/Internal/Support/ModuleUtil.h
index 78998051..4c3243ce 100644
--- a/include/klee/Internal/Support/ModuleUtil.h
+++ b/include/klee/Internal/Support/ModuleUtil.h
@@ -12,15 +12,9 @@
#include "klee/Config/Version.h"
-#if LLVM_VERSION_CODE > LLVM_VERSION(3, 2)
#include "llvm/IR/Module.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
-#else
-#include "llvm/Module.h"
-#include "llvm/Function.h"
-#include "llvm/LLVMContext.h"
-#endif
#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5)
#include "llvm/IR/CallSite.h"
diff --git a/include/klee/util/GetElementPtrTypeIterator.h b/include/klee/util/GetElementPtrTypeIterator.h
index 2d145cd6..5fb9f4ec 100644
--- a/include/klee/util/GetElementPtrTypeIterator.h
+++ b/include/klee/util/GetElementPtrTypeIterator.h
@@ -18,32 +18,22 @@
#ifndef KLEE_UTIL_GETELEMENTPTRTYPE_H
#define KLEE_UTIL_GETELEMENTPTRTYPE_H
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3)
#include "llvm/IR/User.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Constants.h"
-#else
-#include "llvm/User.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0)
-#include "llvm/Constants.h"
-#endif
-#endif
#include "klee/Config/Version.h"
namespace klee {
- template<typename ItTy = llvm::User::const_op_iterator>
- class generic_gep_type_iterator
- : public std::iterator<std::forward_iterator_tag,
- LLVM_TYPE_Q llvm::Type *, ptrdiff_t> {
- typedef std::iterator<std::forward_iterator_tag,
- LLVM_TYPE_Q llvm::Type *, ptrdiff_t> super;
+template <typename ItTy = llvm::User::const_op_iterator>
+class generic_gep_type_iterator
+ : public std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t> {
+ typedef std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t>
+ super;
ItTy OpIt;
- LLVM_TYPE_Q llvm::Type *CurTy;
+ llvm::Type *CurTy;
generic_gep_type_iterator() {}
llvm::Value *asValue(llvm::Value *V) const { return V; }
@@ -52,9 +42,7 @@ namespace klee {
}
public:
-
- static generic_gep_type_iterator begin(LLVM_TYPE_Q llvm::Type *Ty,
- ItTy It) {
+ static generic_gep_type_iterator begin(llvm::Type *Ty, ItTy It) {
generic_gep_type_iterator I;
I.CurTy = Ty;
I.OpIt = It;
@@ -74,24 +62,21 @@ namespace klee {
return !operator==(x);
}
- LLVM_TYPE_Q llvm::Type *operator*() const {
- return CurTy;
- }
+ llvm::Type *operator*() const { return CurTy; }
- LLVM_TYPE_Q llvm::Type *getIndexedType() const {
- LLVM_TYPE_Q llvm::CompositeType *CT = cast<llvm::CompositeType>(CurTy);
+ llvm::Type *getIndexedType() const {
+ llvm::CompositeType *CT = cast<llvm::CompositeType>(CurTy);
return CT->getTypeAtIndex(getOperand());
}
// This is a non-standard operator->. It allows you to call methods on the
// current type directly.
- LLVM_TYPE_Q llvm::Type *operator->() const { return operator*(); }
+ llvm::Type *operator->() const { return operator*(); }
llvm::Value *getOperand() const { return asValue(*OpIt); }
generic_gep_type_iterator& operator++() { // Preincrement
- if (LLVM_TYPE_Q llvm::CompositeType *CT =
- dyn_cast<llvm::CompositeType>(CurTy)) {
+ if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) {
CurTy = CT->getTypeAtIndex(getOperand());
} else {
CurTy = 0;
@@ -149,15 +134,15 @@ namespace klee {
return vce_type_iterator::end(CE->getIndices().end());
}
- template<typename ItTy>
- inline generic_gep_type_iterator<ItTy>
- gep_type_begin(LLVM_TYPE_Q llvm::Type *Op0, ItTy I, ItTy E) {
+ template <typename ItTy>
+ inline generic_gep_type_iterator<ItTy> gep_type_begin(llvm::Type *Op0, ItTy I,
+ ItTy E) {
return generic_gep_type_iterator<ItTy>::begin(Op0, I);
}
- template<typename ItTy>
- inline generic_gep_type_iterator<ItTy>
- gep_type_end(LLVM_TYPE_Q llvm::Type *Op0, ItTy I, ItTy E) {
+ template <typename ItTy>
+ inline generic_gep_type_iterator<ItTy> gep_type_end(llvm::Type *Op0, ItTy I,
+ ItTy E) {
return generic_gep_type_iterator<ItTy>::end(E);
}
} // end namespace klee