Hello all,
I have some custom transform passes written. Till now I am building them from the utils folder so there was no issue. But now I have created a seperated folder for the passes in Transform folder.
CMakeLists.txt (within the CustomPasses folder) :-
add_llvm_component_library(LLVMTransformCustomPasses
MyCPass1.cpp
MycPass2.cpp
MyCPass3.cppADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/Transforms/CustomPassesLINK_COMPONENTS
Analysis
Core
Support
)
In CMakeLists.txt (within the Transform folder) :-
add_subdirectory(CustomPasses)
Added header files in PassBuilder.cpp and Registered Pass names in PassRegister.def
I am getting the following linker error :-
ld.lld: error: undefined symbol: llvm::MyCPass1::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)
>>> referenced by PassBuilder.cpp
>>> PassBuilder.cpp.o:(llvm::detail::PassModel<llvm::Module, llvm::MyCPass1, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&)) in archive lib/libLLVMPasses.a
What exactly am I missing here?