namespace llvm {<br> class PassRegistry;<br> void initializeFooPass(PassRegistry&);<br>}<br><br>using namespace llvm;<br><br>namespace {<br> class Foo : public ModulePass {<br> public:<br> static char ID;<br> Foo() : ModulePass(ID) {<br>
initializeFooPass(*PassRegistry::getPassRegistry());<br> }<br><br> bool runOnModule(Module& M) {<br> M.dump();<br> return false;<br> }<br> };<br>}<br><br>char Foo::ID = 0;<br>INITIALIZE_PASS(Foo, "foo", "DUMP MODULE", false, false)<br>
<br>I have the above pass written for llvm 2.9. When I load the module with opt, I get <br>Unknown command line argument '-foo'.<br><br>Am I missing some intialization step.<br><br>Thanks,<br>Arushi<br>~ <br>
<br><div class="gmail_quote">On Mon, May 16, 2011 at 11:33 AM, Arushi Aggarwal <span dir="ltr"><<a href="mailto:arushi987@gmail.com">arushi987@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>Is the RegisterPass interface still supported, or do we have to use the INITIALIZE_PASS construct to register passes?<br><br>Thanks,<br><font color="#888888">Arushi<br>
</font></blockquote></div><br>