about summary refs log tree commit diff homepage
path: root/include
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-07-20 13:35:52 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-07-20 13:35:52 +0000
commited9ea0cf9dc856920afc6813fa1bea0ec7660ba1 (patch)
tree46de7f5cae7ce4b8a7f5fee7f66f4d2f551b9a47 /include
parent384a6c5652ae815f33e2a6cd1013b1cf14caed63 (diff)
downloadklee-ed9ea0cf9dc856920afc6813fa1bea0ec7660ba1.tar.gz
Deprecate LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR in favour of
version codes.  This makes the preprocessor-based version tests more
concise and less error prone.

Also, fix the version tests in lib/Expr/Parser.cpp (immutable zext
and trunc were introduced in LLVM 2.9); now 2.9 passes "make test".

git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@135583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/klee/Config/Version.h18
-rw-r--r--include/klee/Config/config.h.in5
-rw-r--r--include/klee/Internal/Module/KInstruction.h4
-rw-r--r--include/klee/Statistic.h4
-rw-r--r--include/klee/util/Bits.h4
-rw-r--r--include/klee/util/GetElementPtrTypeIterator.h3
6 files changed, 31 insertions, 7 deletions
diff --git a/include/klee/Config/Version.h b/include/klee/Config/Version.h
new file mode 100644
index 00000000..f5adaa66
--- /dev/null
+++ b/include/klee/Config/Version.h
@@ -0,0 +1,18 @@
+//===-- Version.h -----------------------------------------------*- C++ -*-===//
+//
+//                     The KLEE Symbolic Virtual Machine
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef KLEE_CONFIG_VERSION_H
+#define KLEE_CONFIG_VERSION_H
+
+#include "klee/Config/config.h"
+
+#define LLVM_VERSION(major, minor) (((major) << 8) | (minor))
+#define LLVM_VERSION_CODE LLVM_VERSION(LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR)
+
+#endif
diff --git a/include/klee/Config/config.h.in b/include/klee/Config/config.h.in
index 653b27a4..023d04fe 100644
--- a/include/klee/Config/config.h.in
+++ b/include/klee/Config/config.h.in
@@ -1,5 +1,8 @@
 /* include/klee/Config/config.h.in.  Generated from autoconf/configure.tmp.ac by autoheader.  */
 
+#ifndef KLEE_CONFIG_CONFIG_H
+#define KLEE_CONFIG_CONFIG_H
+
 /* Does the platform use __ctype_b_loc, etc. */
 #undef HAVE_CTYPE_EXTERNALS
 
@@ -74,3 +77,5 @@
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
+
+#endif
diff --git a/include/klee/Internal/Module/KInstruction.h b/include/klee/Internal/Module/KInstruction.h
index f6becd4a..c96d103b 100644
--- a/include/klee/Internal/Module/KInstruction.h
+++ b/include/klee/Internal/Module/KInstruction.h
@@ -10,8 +10,8 @@
 #ifndef KLEE_KINSTRUCTION_H
 #define KLEE_KINSTRUCTION_H
 
-#include "klee/Config/config.h"
-#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9)
+#include "klee/Config/Version.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
 #include "llvm/System/DataTypes.h"
 #else
 #include "llvm/Support/DataTypes.h"
diff --git a/include/klee/Statistic.h b/include/klee/Statistic.h
index 6261fd95..f567f680 100644
--- a/include/klee/Statistic.h
+++ b/include/klee/Statistic.h
@@ -10,8 +10,8 @@
 #ifndef KLEE_STATISTIC_H
 #define KLEE_STATISTIC_H
 
-#include "klee/Config/config.h"
-#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9)
+#include "klee/Config/Version.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
 #include "llvm/System/DataTypes.h"
 #else
 #include "llvm/Support/DataTypes.h"
diff --git a/include/klee/util/Bits.h b/include/klee/util/Bits.h
index 06703604..f2bb7692 100644
--- a/include/klee/util/Bits.h
+++ b/include/klee/util/Bits.h
@@ -10,8 +10,8 @@
 #ifndef KLEE_UTIL_BITS_H
 #define KLEE_UTIL_BITS_H
 
-#include "klee/Config/config.h"
-#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9)
+#include "klee/Config/Version.h"
+#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9)
 #include "llvm/System/DataTypes.h"
 #else
 #include "llvm/Support/DataTypes.h"
diff --git a/include/klee/util/GetElementPtrTypeIterator.h b/include/klee/util/GetElementPtrTypeIterator.h
index c552595c..302c19ef 100644
--- a/include/klee/util/GetElementPtrTypeIterator.h
+++ b/include/klee/util/GetElementPtrTypeIterator.h
@@ -21,7 +21,8 @@
 #include "llvm/User.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Instructions.h"
-#if (LLVM_VERSION_MAJOR > 2)
+#include "klee/Config/Version.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0)
 #include "llvm/Constants.h"
 #endif