about summary refs log tree commit diff homepage
path: root/lib/Expr
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 /lib/Expr
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 'lib/Expr')
-rw-r--r--lib/Expr/Expr.cpp3
-rw-r--r--lib/Expr/Parser.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 08d5cd27..420eaa90 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "klee/Expr.h"
+#include "klee/Config/Version.h"
 
 #include "llvm/Support/CommandLine.h"
 // FIXME: We shouldn't need this once fast constant support moves into
@@ -346,7 +347,7 @@ void ConstantExpr::toString(std::string &Res) const {
 ref<ConstantExpr> ConstantExpr::Concat(const ref<ConstantExpr> &RHS) {
   Expr::Width W = getWidth() + RHS->getWidth();
   APInt Tmp(value);
-#if (LLVM_VERSION_MAJOR <= 2 && LLVM_VERSION_MINOR <= 8)
+#if LLVM_VERSION_CODE <= LLVM_VERSION(2, 8)
   Tmp.zext(W);
 #else
   Tmp=Tmp.zext(W);
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp
index a41c5624..a94d5614 100644
--- a/lib/Expr/Parser.cpp
+++ b/lib/Expr/Parser.cpp
@@ -11,6 +11,7 @@
 
 #include "expr/Lexer.h"
 
+#include "klee/Config/Version.h"
 #include "klee/Constraints.h"
 #include "klee/ExprBuilder.h"
 #include "klee/Solver.h"
@@ -1496,13 +1497,13 @@ ExprResult ParserImpl::ParseNumberToken(Expr::Width Type, const Token &Tok) {
     Val = -Val;
 
   if (Type < Val.getBitWidth())
-#if (LLVM_VERSION_MAJOR < 3)
+#if LLVM_VERSION_CODE <= LLVM_VERSION(2, 8)
     Val.trunc(Type);
 #else
     Val=Val.trunc(Type);
 #endif
   else if (Type > Val.getBitWidth())
-#if (LLVM_VERSION_MAJOR < 3)
+#if LLVM_VERSION_CODE <= LLVM_VERSION(2, 8)
     Val.zext(Type);
 #else
     Val=Val.zext(Type);