Hi all I'm writing a pass for the llc tool. If I try to load my pass(llc -load ../mypass.so), this error message appears : Error opening '/nfs/wsi/ti/graumann/llvm-2.5/Release/lib/LLVMMicha.so': /nfs/wsi/ti/graumann/llvm-2.5/Release/lib/LLVMMicha.so: undefined symbol: _ZTVN12_GLOBAL__N_119MyRegisterAllocatorE -load request ignored. Is this code wrong for the pass registration, or the makefile? Thank you for help Michael Code of my pass: using namespace llvm; namespace { struct MyRegisterAllocator : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid MyRegisterAllocator() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); }; char MyRegisterAllocator::ID = 0; } static RegisterPass<MyRegisterAllocator>X("myregalloc", " my register allocator help string"); FunctionPass* createMyRegisterAllocator() { return new MyRegisterAllocator(); } static RegisterRegAlloc MyRegAlloc("myregalloc", " my register allocator help string", createMyRegisterAllocator); the makefile: LEVEL = ../../.. LIBRARYNAME = LLVMMicha LOADABLE_MODULE = 1 USEDLIBS #LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a LINK_COMPONENTS = support system include $(LEVEL)/Makefile.common -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090811/6be03553/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 6952 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090811/6be03553/attachment.bin>
On Aug 11, 2009, at 8:23 AM, Michael Graumann wrote:> I'm writing a pass for the llc tool. If I try to load my pass(llc - > load ../mypass.so), this error message appears : > > Error opening '/nfs/wsi/ti/graumann/llvm-2.5/Release/lib/ > LLVMMicha.so': /nfs/wsi/ti/graumann/llvm-2.5/Release/lib/ > LLVMMicha.so: undefined symbol: > _ZTVN12_GLOBAL__N_119MyRegisterAllocatorE > -load request ignored.You have to define (instantiate) all your virtual functions. runOnMachineFunction is one such function, there may be others as well.
Hi At the moment there are in my pass only this virtual function (runOnMachineFunction). maybe is there an other reason? Thank you Michael -----Ursprüngliche Nachricht----- Von: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] Im Auftrag von Mike Stump Gesendet: Dienstag, 11. August 2009 19:16 An: LLVM Developers Mailing List Betreff: Re: [LLVMdev] llc undefined symbol On Aug 11, 2009, at 8:23 AM, Michael Graumann wrote:> I'm writing a pass for the llc tool. If I try to load my pass(llc - > load ../mypass.so), this error message appears : > > Error opening '/nfs/wsi/ti/graumann/llvm-2.5/Release/lib/ > LLVMMicha.so': /nfs/wsi/ti/graumann/llvm-2.5/Release/lib/ > LLVMMicha.so: undefined symbol: > _ZTVN12_GLOBAL__N_119MyRegisterAllocatorE > -load request ignored.You have to define (instantiate) all your virtual functions. runOnMachineFunction is one such function, there may be others as well. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 6952 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090811/ad3d2d68/attachment.bin>