Compilation 为什么llvm构建没有';看不到自定义后端?
我正在尝试为LLVM编写自定义后端。我将Compilation 为什么llvm构建没有';看不到自定义后端?,compilation,compiler-construction,cmake,llvm,Compilation,Compiler Construction,Cmake,Llvm,我正在尝试为LLVM编写自定义后端。我将llvm/lib/Target/AVR文件夹复制到llvm/lib/Target/Abc(这是我的后端)。然后,我将文件名和文件内容中的所有AVR替换为Abc,将AVR替换为Abc。下面是CMakeLists.txt: set(LLVM_TARGET_DEFINITIONS Abc.td) tablegen(LLVM AbcGenRegisterInfo.inc -gen-register-info) tablegen(LLVM AbcGenInstrI
llvm/lib/Target/AVR
文件夹复制到llvm/lib/Target/Abc
(这是我的后端)。然后,我将文件名和文件内容中的所有AVR
替换为Abc
,将AVR
替换为Abc
。下面是CMakeLists.txt
:
set(LLVM_TARGET_DEFINITIONS Abc.td)
tablegen(LLVM AbcGenRegisterInfo.inc -gen-register-info)
tablegen(LLVM AbcGenInstrInfo.inc -gen-instr-info)
tablegen(LLVM AbcGenCallingConv.inc -gen-callingconv)
tablegen(LLVM AbcGenSubtargetInfo.inc -gen-subtarget)
add_public_tablegen_target(AbcCommonTableGen)
add_llvm_target(AbcCodeGen
AbcInstrInfo.cpp
AbcRegisterInfo.cpp
AbcTargetMachine.cpp
AbcTargetObjectFile.cpp
)
add_dependencies(LLVMAbcCodeGen intrinsincs_gen)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
我尝试将Abd
添加到LLVM/CMakeLists.txt
中的LLVM\u ALL\u TARGETS
变量中,但当我尝试运行cmake
时,显示以下错误:
llvm-build: error: invalid target to enable: 'Abc' not in project
我还尝试从
llvm/CMakeLists.txt
中删除Abc
,并使用-DLLVM\u EXPERIMENTAL\u TARGETS\u to_BUILD=Abc
运行cmake
,但结果是一样的。问题是我没有将Abc
添加到llvm/lib/Target/LLVMBuild.txt中的子目录中