D
D
Daniil Kolesnichenko2016-08-12 13:04:24
CMake
Daniil Kolesnichenko, 2016-08-12 13:04:24

Why doesn't llvm-build see the new backend?

I'm writing a backend for LLVM, let's say it's called Abc . I copied the directory llvm/lib/Target/AVRto llvm/lib/Target/Abc, bash- and sed-scripts replaced in the file names and in the files themselves AVR with Abc , avr with abc . CMakeLists.txtlooks like that:

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)

If I llvm/CMakeLists.txtadd Abcto LLVM_ALL_TARGETS, it writes the following:
llvm-build: error: invalid target to enable: 'Abc' not in project

If you remove it Abcfrom LLVM_ALL_TARGETSand assemble it with a key -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=Abc- the same error. What else needs to be edited so that llvm-build "sees" my backend?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Kolesnichenko, 2016-08-12
@KolesnichenkoDS

It was also necessary to add Abc tollvm/lib/Targets/LLVMBuild.txt

S
Stanislav Makarov, 2016-08-12
@Nipheris

Try adding your target Abcto the LLVM_ALL_TARGETS list located in the root CMakeLists. With this list, then all sorts of things are done, it seems to me that all the targets that are in the project should be there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question