c++ - How to link one llvm pass to another? -
i have 2 llvm passes. dveloped @ first independent, need combine them , use information 1 of them in another. structure is:
first_pass/
******first_pass.cpp
******cmakelists.txt
second_pass/
******second_pass.cpp
******some_additional_files
******cmakelists.txt
includes/
cmakelists.txt
in common cmakelists file include 2 directories. use class second_pass in first_pass.
two cmakes:
set(cmake_build_type debug) add_library(mycfgpass module mycfgpass.cpp) #target_link_libraries(mycfgpass llvmpass) target_compile_features(mycfgpass private cxx_range_for cxx_auto_type) set(cmake_cxx_flags "-fno-rtti") set(cmake_build_type debug) add_definitions(-dtests) add_definitions(-dstats) add_library( llvmpass module llvmpass.cpp info.cpp printf.cpp utils.cpp ) target_compile_options(llvmpass public -g3 -o0 -std=c++14 -pedantic -wall) # target_compile_options(llvmpass public -g3 -o0 -std=c++14 -pedantic -wall) set(cmake_cxx_flags "-fno-rtti") then go error symbol llvmpass undefined. can't link library (llvmpass) because of module type - llvm requires. if create 2 libraries (.so , .a) - registering pass twice. can solution?
Comments
Post a Comment