From ed9ea0cf9dc856920afc6813fa1bea0ec7660ba1 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 20 Jul 2011 13:35:52 +0000 Subject: 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 --- tools/kleaver/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tools/kleaver') diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp index 0581ea27..0c4a78f7 100644 --- a/tools/kleaver/main.cpp +++ b/tools/kleaver/main.cpp @@ -3,6 +3,7 @@ #include "expr/Lexer.h" #include "expr/Parser.h" +#include "klee/Config/Version.h" #include "klee/Constraints.h" #include "klee/Expr.h" #include "klee/ExprBuilder.h" @@ -25,7 +26,7 @@ #undef PACKAGE_TARNAME #undef PACKAGE_VERSION -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) #include "llvm/System/Signals.h" #else #include "llvm/Support/Signals.h" @@ -283,7 +284,7 @@ int main(int argc, char **argv) { std::string ErrorStr; -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) MemoryBuffer *MB = MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), &ErrorStr); if (!MB) { std::cerr << argv[0] << ": error: " << ErrorStr << "\n"; @@ -316,14 +317,14 @@ int main(int argc, char **argv) { switch (ToolAction) { case PrintTokens: -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) PrintInputTokens(MB); #else PrintInputTokens(MB.get()); #endif break; case PrintAST: -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) success = PrintInputAST(InputFile=="-" ? "" : InputFile.c_str(), MB, Builder); #else @@ -332,7 +333,7 @@ int main(int argc, char **argv) { #endif break; case Evaluate: -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) success = EvaluateInputAST(InputFile=="-" ? "" : InputFile.c_str(), MB, Builder); #else @@ -345,7 +346,7 @@ int main(int argc, char **argv) { } delete Builder; -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) delete MB; #endif llvm::llvm_shutdown(); -- cgit 1.4.1