Problem in Adding a pass to LLVM

Hi,

I am trying to add alias analysis in llvm. I created a file ProfileAlias.cpp in llvm source at the place where Andersens.cpp is there. ProfileAlias.cpp does nothing at present just empty definitions of required functions.

When I build llvm I get the following error:

/home/ambika/llvm1/llvm-obj/Release/lib/libLLVMipa.a(ProfileAlias.o): In function `llvm::createProfileAliasPass()':
ProfileAlias.cpp:(.text+0x46): undefined reference to `vtable for ProfileAlias'
/home/ambika/llvm1/llvm-obj/Release/lib/libLLVMipa.a(ProfileAlias.o): In function `llvm::Pass* llvm::callDefaultCtor<ProfileAlias>()':
ProfileAlias.cpp:(.text._ZN4llvm15callDefaultCtorI12ProfileAliasEEPNS_4PassEv[llvm::Pass* llvm::callDefaultCtor<ProfileAlias>()]+0x26): undefined reference to `vtable for ProfileAlias'
/usr/bin/ld: /home/ambika/llvm1/llvm-obj/Release/bin/opt: hidden symbol `vtable for ProfileAlias' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output

Can someone help me with this.

regards,
Ambika

Hi!

Well I have given empty bodies for all virtual functions but still I get the same error.
I referred to http://llvm.org/docs/AliasAnalysis.html#writingnew and followed the steps but still cannot build llvm.

regards,
Ambika

Andreas Neustifter wrote:

Well I have given empty bodies for all virtual functions but still I get the same error.
I referred to http://llvm.org/docs/AliasAnalysis.html#writingnew and followed the steps but still cannot build llvm.

regards,
Ambika

Andreas Neustifter wrote: