diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/kleaver/main.cpp | 13 | ||||
-rw-r--r-- | tools/klee/main.cpp | 16 |
2 files changed, 15 insertions, 14 deletions
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=="-" ? "<stdin>" : 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=="-" ? "<stdin>" : 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(); diff --git a/tools/klee/main.cpp b/tools/klee/main.cpp index e37eb00a..12f90f2a 100644 --- a/tools/klee/main.cpp +++ b/tools/klee/main.cpp @@ -7,7 +7,7 @@ #include "klee/Expr.h" #include "klee/Interpreter.h" #include "klee/Statistics.h" -#include "klee/Config/config.h" +#include "klee/Config/Version.h" #include "klee/Internal/ADT/KTest.h" #include "klee/Internal/ADT/TreeStream.h" #include "klee/Internal/Support/ModuleUtil.h" @@ -15,14 +15,14 @@ #include "llvm/Constants.h" #include "llvm/Module.h" -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7) #include "llvm/ModuleProvider.h" #endif #include "llvm/Type.h" #include "llvm/InstrTypes.h" #include "llvm/Instruction.h" #include "llvm/Instructions.h" -#if !(LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 7) #include "llvm/LLVMContext.h" #endif #include "llvm/Bitcode/ReaderWriter.h" @@ -37,7 +37,7 @@ #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #include "llvm/Target/TargetSelect.h" -#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" @@ -526,7 +526,7 @@ void KleeHandler::getOutFiles(std::string path, } for (std::set<llvm::sys::Path>::iterator it = contents.begin(), ie = contents.end(); it != ie; ++it) { -#if !(LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR == 6) +#if LLVM_VERSION_CODE != LLVM_VERSION(2, 6) std::string f = it->str(); #else std::string f = it->toString(); @@ -1148,7 +1148,7 @@ int main(int argc, char **argv, char **envp) { sys::SetInterruptFunction(interrupt_handle); // Load the bytecode... -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7) std::string ErrorMsg; ModuleProvider *MP = 0; if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile, &ErrorMsg)) { @@ -1165,7 +1165,7 @@ int main(int argc, char **argv, char **envp) { #endif std::string ErrorMsg; Module *mainModule = 0; -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile, &ErrorMsg); if (Buffer) { mainModule = getLazyBitcodeModule(Buffer, getGlobalContext(), &ErrorMsg); @@ -1464,7 +1464,7 @@ int main(int argc, char **argv, char **envp) { std::cerr << stats.str(); handler->getInfoStream() << stats.str(); -#if !(LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 9) BufferPtr.take(); #endif delete handler; |