Compilation 为什么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编写自定义后端。我将
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中的
子目录中