Commit c883ba2d authored by Administrator's avatar Administrator
Browse files

correct clang/opt version to be used for sample generation

parent 156593d3
...@@ -319,8 +319,8 @@ if (APPLE) ...@@ -319,8 +319,8 @@ if (APPLE)
foreach(src ${SAMPLES}) foreach(src ${SAMPLES})
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll
COMMAND clang --sysroot ${CMAKE_OSX_SYSROOT} -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.c -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc COMMAND ${PATH_TO_LLVM}/bin/clang --sysroot ${CMAKE_OSX_SYSROOT} -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.c -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc
COMMAND opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll COMMAND ${PATH_TO_LLVM}/bin/opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll
DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.c DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.c
COMMENT "Generating LLVM IR for example ${src}.c" COMMENT "Generating LLVM IR for example ${src}.c"
) )
...@@ -329,8 +329,8 @@ endforeach(src) ...@@ -329,8 +329,8 @@ endforeach(src)
foreach(src ${CPPSAMPLES}) foreach(src ${CPPSAMPLES})
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll
COMMAND clang++ --sysroot ${CMAKE_OSX_SYSROOT} -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.cpp -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc COMMAND ${PATH_TO_LLVM}/bin/clang++ --sysroot ${CMAKE_OSX_SYSROOT} -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.cpp -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc
COMMAND opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll COMMAND ${PATH_TO_LLVM}/bin/opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll
DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.cpp DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.cpp
COMMENT "Generating LLVM IR for example ${src}.cpp" COMMENT "Generating LLVM IR for example ${src}.cpp"
) )
...@@ -341,8 +341,8 @@ else() ...@@ -341,8 +341,8 @@ else()
foreach(src ${SAMPLES}) foreach(src ${SAMPLES})
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll
COMMAND clang -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.c -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc COMMAND ${PATH_TO_LLVM}/bin/clang -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.c -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc
COMMAND opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll COMMAND ${PATH_TO_LLVM}/bin/opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll
DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.c DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.c
COMMENT "Generating LLVM IR for example ${src}.c" COMMENT "Generating LLVM IR for example ${src}.c"
) )
...@@ -351,8 +351,8 @@ endforeach(src) ...@@ -351,8 +351,8 @@ endforeach(src)
foreach(src ${CPPSAMPLES}) foreach(src ${CPPSAMPLES})
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll OUTPUT ${CMAKE_SOURCE_DIR}/output/${src}.ll
COMMAND clang++ -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.cpp -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc COMMAND ${PATH_TO_LLVM}/bin/clang++ -O0 -emit-llvm ${CMAKE_SOURCE_DIR}/samples/${src}.cpp -Xclang -disable-O0-optnone -c -o ${CMAKE_SOURCE_DIR}/output/${src}.bc
COMMAND opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll COMMAND ${PATH_TO_LLVM}/bin/opt -S -mem2reg ${CMAKE_SOURCE_DIR}/output/${src}.bc -o ${CMAKE_SOURCE_DIR}/output/${src}.ll
DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.cpp DEPENDS clang opt ${CMAKE_SOURCE_DIR}/samples/${src}.cpp
COMMENT "Generating LLVM IR for example ${src}.cpp" COMMENT "Generating LLVM IR for example ${src}.cpp"
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment