Problem I have to run a llvm module pass from main function

I need to integrate my module pass with someone else’s flow. My pass should be run inside the main() of their flow to generate the information needed for other functions. My pass is declared as:

MyVec: public ModulePass



I used to build it into a loadable module for “opt” and it works. Right now, in the main function, I call the MyVec pass with the new method:



llvm::ModulePass* V = new MyVec();



But the linking process reports:

llvm[0]: Linking Release executable vec_a (without symbols)

llvm[0]: ======= Finished Linking Release Executable vec_a (without symbols)

My Makefile is written as follows:



LINK_COMPONENTS := core support bitreader bitwriter asmparser instrumentation scalaropts ipo

include $(LEVEL)/Makefile.common

Anyone have any idea of where goes wrong? Thanks.