Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion llvm/cmake/modules/TableGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ function(tablegen project ofn)
list(APPEND LLVM_TABLEGEN_FLAGS "-omit-comments")
endif()

set(EXTRA_OUTPUTS)
if("-gen-register-info" IN_LIST ARGN)
cmake_path(GET ofn STEM OUTPUT_BASENAME)
list(APPEND EXTRA_OUTPUTS
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_BASENAME}Enums.inc
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_BASENAME}Header.inc
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_BASENAME}MCDesc.inc
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_BASENAME}TargetDesc.inc)
endif()

# MSVC can't support long string literals ("long" > 65534 bytes)[1], so if there's
# a possibility of generated tables being consumed by MSVC, generate arrays of
# char literals, instead. If we're cross-compiling, then conservatively assume
Expand Down Expand Up @@ -126,7 +136,7 @@ function(tablegen project ofn)
set(LLVM_TABLEGEN_JOB_POOL "")
endif()

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn} ${EXTRA_OUTPUTS}
COMMAND ${tablegen_exe} ${ARG_UNPARSED_ARGUMENTS}
${tblgen_includes}
${LLVM_TABLEGEN_FLAGS}
Expand Down
2 changes: 2 additions & 0 deletions llvm/utils/TableGen/RegisterInfoEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,8 @@ TableGenOutputFiles RegisterInfoEmitter::run(StringRef FilenamePrefix) {
if (RegisterInfoDebug)
debugDump(errs());

// The suffixes should be in sync with the tablegen function in
// llvm/cmake/modules/TableGen.cmake.
return {Main,
{{"Enums.inc", Enums},
{"MCDesc.inc", MCDesc},
Expand Down
Loading