[LLVMdev] Upgrading to llvm-2.9

Arushi Aggarwal arushi987 at gmail.com
Mon May 16 13:04:37 PDT 2011


namespace llvm {
  class PassRegistry;
  void initializeFooPass(PassRegistry&);
}

using namespace llvm;

namespace {
  class Foo : public ModulePass {
  public:
    static char ID;
    Foo() : ModulePass(ID) {
      initializeFooPass(*PassRegistry::getPassRegistry());
    }

    bool runOnModule(Module& M) {
      M.dump();
      return false;
    }
  };
}

char Foo::ID = 0;
INITIALIZE_PASS(Foo, "foo", "DUMP MODULE", false, false)

I have the above pass written for llvm 2.9. When I load the module with opt,
I get
Unknown command line argument '-foo'.

Am I missing some intialization step.

Thanks,
Arushi
~

On Mon, May 16, 2011 at 11:33 AM, Arushi Aggarwal <arushi987 at gmail.com>wrote:

> Hi,
>
> Is the RegisterPass interface still supported, or do we have to use the
> INITIALIZE_PASS construct to register passes?
>
> Thanks,
> Arushi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110516/bbcb489b/attachment.html>


More information about the llvm-dev mailing list