[LLVMdev] Regarding a pass in LLVM

ambika at cse.iitb.ac.in
Mon, 22 Feb 2010 20:21:15 -0000

Hi,

I am trying to add a pass inn LLVM, and I actually want to add it in
source code, not just directly into object code.

For that I included the lines in my file MyAna.cpp
(llvm-2.6/lib/ana/MyAna.cpp)


char MyAna::ID = 0;
static RegisterPass<MyAna> X("my-aa","My Analysis");
static RegisterAnalysisGroup<AliasAnalysis> Y(X);

ModulePass *llvm::createMyAnaPass() { return new MyAna(); }


I also included createMyAnaPass() in Passes.h and LinkAllPasses.h
But when I do make I get the following error :

/home/ambika/llvm/llvm-obj/tools/opt/Release/opt.o: In function `global
constructors keyed to opt.cpp':
opt.cpp:(.text+0x1e89): undefined reference to `llvm::createMyAnaPass()'


Am I missing out something.

Please help me.

thanks and regards,
Ambika