Changeset 5196


Ignore:
Timestamp:
Oct 17, 2016, 8:21:23 PM (2 years ago)
Author:
faldebey
Message:

Improved syntax for LLVM-3.6 and LLVM-3.7 macros

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5185 r5196  
    182182
    183183# detect LLVM version and add compiler flags.
    184 IF (${LLVM_PACKAGE_VERSION} MATCHES "3.5")
    185   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LLVM_3_5")
     184SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_VERSION_major=${LLVM_VERSION_MAJOR} -DLLVM_VERSION_MINOR=${LLVM_VERSION_MINOR}")
     185IF (${LLVM_VERSION_MAJOR} EQUAL 3)
     186  IF (${LLVM_VERSION_MINOR} EQUAL 6)
     187    message(STATUS "Found LLVM ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
     188    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LLVM_3_6")
     189  ELSEIF (${LLVM_VERSION_MINOR} EQUAL 7)
     190    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LLVM_3_7")
     191  ENDIF()
    186192ENDIF()
    187193
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5187 r5196  
    321321int main(int argc, char *argv[]) {
    322322    llvm::install_fatal_error_handler(&icgrep_error_handler);
    323 #if LLVM_VERSION_MINOR > 6
     323#ifndef USE_LLVM_3_6
    324324    cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *>{&LegacyGrepOptions, &EnhancedGrepOptions, re::re_toolchain_flags(), pablo::pablo_toolchain_flags(), codegen::codegen_flags()});
    325325#endif
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r5186 r5196  
    129129}
    130130
    131 #if LLVM_VERSION_MINOR > 6
     131#ifndef USE_LLVM_3_6
    132132void WriteAssembly (llvm::TargetMachine *TM, Module * m) {
    133133    llvm::legacy::PassManager PM;
Note: See TracChangeset for help on using the changeset viewer.