Erdem Derebaşoğlu via llvm-dev
2015-Sep-27 18:54 UTC
[llvm-dev] Registering a MachineFunctionPass
Dear all, I wrote a machine function pass to run with llc. But I get this error while building: "/home/erdem/llvm/lib/CodeGen/CodeGen.cpp:80: error: undefined reference to 'llvm::initializeNoopInserterPass(llvm::PassRegistry&)'" NoopInserter is the name of my pass. I already added this line to InitializePasses.h: "void initializeNoopInserterPass(PassRegistry&);". Can anyone tell me what the problem is? Thanks in advance,Erdem Derebasoglu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150927/8990c6b4/attachment.html>
Yaron Keren via llvm-dev
2015-Sep-28 09:13 UTC
[llvm-dev] Registering a MachineFunctionPass
The code probably misses the INITIALIZE_PASS macro, see bottom of BarrierNoopPass.cpp INITIALIZE_PASS(BarrierNoop, "barrier", "A No-Op Barrier Pass", false, false) 2015-09-27 21:54 GMT+03:00 Erdem Derebaşoğlu <llvm-dev at lists.llvm.org>:> Dear all, > > I wrote a machine function pass to run with llc. But I get this error > while building: > > "/home/erdem/llvm/lib/CodeGen/CodeGen.cpp:80: error: undefined reference > to 'llvm::initializeNoopInserterPass(llvm::PassRegistry&)'" > > NoopInserter is the name of my pass. I already added this line to > InitializePasses.h: "void initializeNoopInserterPass(PassRegistry&);". > > Can anyone tell me what the problem is? > > Thanks in advance, > Erdem Derebasoglu > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150928/c3d2b0bc/attachment.html>
Erdem Derebaşoğlu via llvm-dev
2015-Sep-28 12:10 UTC
[llvm-dev] Registering a MachineFunctionPass
I had INITIALIZE_PASS_BEGIN and INITIALIZE_PASS_END macros. I replaced them with INITIALIZE_PASS but I get the same error. If I understand correctly, I need to modify Passes.h, InitializePasses.h, and Codegen.cpp files to register my pass, right? Another question is: Is it necessary to have the createNoopInserterPass function? Erdem -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150928/8ef7faeb/attachment.html>