Mark MOV8mr_NOREX and MOV8rm_NOREX as mayStore / mayLoad respectively.
[llvm/msp430.git] / cmake / modules / TableGen.cmake
blobadb22c726b927907b4bc7e8019b042e06fab5ef3
1 # LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process.
2 # Extra parameters for `tblgen' may come after `ofn' parameter.
3 # Adds the name of the generated file to TABLEGEN_OUTPUT.
5 macro(tablegen ofn)
6   file(GLOB all_tds "*.td")
8   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
9     COMMAND ${LLVM_TABLEGEN} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
10     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
11     ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS} 
12     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
13     DEPENDS ${LLVM_TABLEGEN} ${all_tds}
14     COMMENT "Building ${ofn}.tmp..."
15     )
16   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
17     COMMAND ${CMAKE_COMMAND} -E copy_if_different 
18     ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
19     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
20     COMMENT "Building ${ofn}..."
21     )
22   set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn})
23 endmacro(tablegen)