gpt4 book ai didi

compilation - 为什么 llvm-build 看不到自定义后端?

转载 作者:行者123 更新时间:2023-12-01 22:22:50 27 4
gpt4 key购买 nike

我正在尝试为 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_ALL_TARGETS 变量,但是当我尝试运行 cmake,显示如下错误:

llvm-build: error: invalid target to enable: 'Abc' not in project

我还尝试从 llvm/CMakeLists.txt 中删除 Abc 并使用 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=Abc 运行 cmake >,但结果是一样的。

最佳答案

问题是我没有将 Abc 添加到 llvm/lib/Target/LLVMBuild.txt 中的 subdirectories

关于compilation - 为什么 llvm-build 看不到自定义后端?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38915215/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com