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 --- lib/Module/Optimize.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Module/Optimize.cpp') diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 633c21a1..e0ae4d99 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -15,14 +15,14 @@ // //===----------------------------------------------------------------------===// -#include "klee/Config/config.h" +#include "klee/Config/Version.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Support/CommandLine.h" -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) #include "llvm/System/DynamicLibrary.h" #else #include "llvm/Support/DynamicLibrary.h" @@ -99,7 +99,7 @@ static void AddStandardCompilePasses(PassManager &PM) { if (DisableOptimizations) return; -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7) addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst #endif addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code @@ -124,7 +124,7 @@ static void AddStandardCompilePasses(PassManager &PM) { addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas addPass(PM, createInstructionCombiningPass()); // Combine silly seq's -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7) addPass(PM, createCondPropagationPass()); // Propagate conditionals #endif @@ -134,7 +134,7 @@ static void AddStandardCompilePasses(PassManager &PM) { addPass(PM, createLoopRotatePass()); addPass(PM, createLICMPass()); // Hoist loop invariants addPass(PM, createLoopUnswitchPass()); // Unswitch loops. -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 9) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 9) addPass(PM, createLoopIndexSplitPass()); // Index split loops. #endif // FIXME : Removing instcombine causes nestedloop regression. @@ -150,7 +150,7 @@ static void AddStandardCompilePasses(PassManager &PM) { // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. addPass(PM, createInstructionCombiningPass()); -#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) +#if LLVM_VERSION_CODE < LLVM_VERSION(2, 7) addPass(PM, createCondPropagationPass()); // Propagate conditionals #endif -- cgit 1.4.1