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

Huang, Hui hui.huang at intel.com
Tue Aug 16 15:09:14 PDT 2011


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:
main()
{
...
llvm::ModulePass* V = new MyVec();
V->runOnModule(M);

...
}

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:

LEVEL=../..

TOOLNAME=vec_a

LINK_COMPONENTS := core support bitreader bitwriter asmparser instrumentation scalaropts ipo

include $(LEVEL)/Makefile.common

Anyone have any idea of where goes wrong? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110817/75685602/attachment.html>


More information about the llvm-dev mailing list