[LLVMdev] Problems creating a pass

Scott Ricketts sricketts at maxentric.com
Fri Jun 19 11:31:57 PDT 2009


Did you try changing the name from Hello to MyHello or something like
that? I seem to remember having a similar problem. My tutorial code
names the struct MyHello and then registers it as follows:

RegisterPass<MyHello> X("myhello", "My Hello World Pass");

You will likely need to change the Makefile as well.

Scott

On Fri, Jun 19, 2009 at 11:15 AM, Juan Carlos Martinez
Santos<juanc.martinez.santos at gmail.com> wrote:
> Hello,
>
> Following the tutorial for writing a pass, I found the next problem.
>
> *****************************
> :~/llvm/test$ opt -load ../llvm/Debug/lib/mypass.so -mypass < hello.bc >
> /dev/null
> opt: Pass.cpp:151: void<unnamed>::PassRegistrar::RegisterPass(const
> llvm::PassInfo&): Assertion `Inserted && "Pass registered multiple times!"'
> failed.
> Aborted
> *****************************
>
> I just <copy> and then <paste> the code that appears in the web page, and
> follow the instructions to run the pass. There is something missed,
> something that is not in the web page
> [http://llvm.org/docs/WritingAnLLVMPass.html#quickstart].
>
> Thanks in advance.
> --
> Juan Carlos
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list