diff --git a/llvm/include/llvm/CMakeLists.txt b/llvm/include/llvm/CMakeLists.txt --- a/llvm/include/llvm/CMakeLists.txt +++ b/llvm/include/llvm/CMakeLists.txt @@ -1,3 +1,10 @@ +if(LLVM_TABLEGEN_TARGET STREQUAL "llvm-tblgen" + AND LLVM_TABLEGEN_EXE STREQUAL "llvm-tblgen" + AND TARGET llvm-min-tblgen) + set(LLVM_TABLEGEN_TARGET "llvm-min-tblgen") + set(LLVM_TABLEGEN_EXE "llvm-min-tblgen") +endif() + add_subdirectory(IR) add_subdirectory(Support) add_subdirectory(Frontend) diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt --- a/llvm/utils/TableGen/CMakeLists.txt +++ b/llvm/utils/TableGen/CMakeLists.txt @@ -1,6 +1,18 @@ add_subdirectory(GlobalISel) -set(LLVM_LINK_COMPONENTS Support) +set(LLVM_LINK_COMPONENTS Support TableGen) + +add_llvm_executable(llvm-min-tblgen EXCLUDE_FROM_ALL + Attributes.cpp + CodeGenIntrinsics.cpp + DirectiveEmitter.cpp + IntrinsicEmitter.cpp + RISCVTargetDefEmitter.cpp + SDNodeProperties.cpp + TableGen.cpp + PARTIAL_SOURCES_INTENDED + ) +set_target_properties(llvm-min-tblgen PROPERTIES FOLDER "Tablegenning") add_tablegen(llvm-tblgen LLVM DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" @@ -8,14 +20,13 @@ AsmMatcherEmitter.cpp AsmWriterEmitter.cpp AsmWriterInst.cpp - Attributes.cpp + CTagsEmitter.cpp CallingConvEmitter.cpp CodeEmitterGen.cpp CodeGenDAGPatterns.cpp CodeGenHwModes.cpp CodeGenInstAlias.cpp CodeGenInstruction.cpp - CodeGenIntrinsics.cpp CodeGenMapTable.cpp CodeGenRegisters.cpp CodeGenSchedule.cpp @@ -28,7 +39,6 @@ DecoderEmitter.cpp DFAEmitter.cpp DFAPacketizerEmitter.cpp - DirectiveEmitter.cpp DisassemblerEmitter.cpp DXILEmitter.cpp ExegesisEmitter.cpp @@ -38,7 +48,6 @@ InfoByHwMode.cpp InstrInfoEmitter.cpp InstrDocsEmitter.cpp - IntrinsicEmitter.cpp OptEmitter.cpp OptParserEmitter.cpp OptRSTEmitter.cpp @@ -47,12 +56,9 @@ CompressInstEmitter.cpp RegisterBankEmitter.cpp RegisterInfoEmitter.cpp - RISCVTargetDefEmitter.cpp - SDNodeProperties.cpp SearchableTableEmitter.cpp SubtargetEmitter.cpp SubtargetFeatureInfo.cpp - TableGen.cpp Types.cpp VarLenCodeEmitterGen.cpp X86DisassemblerTables.cpp @@ -62,7 +68,7 @@ X86ModRMFilters.cpp X86RecognizableInstr.cpp WebAssemblyDisassemblerEmitter.cpp - CTagsEmitter.cpp + $ ) target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenGlobalISel) set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning")