[LLVMdev] Problems with written function pass

Matthijs Kooijman matthijs at stdin.nl
Sun Sep 28 11:39:51 PDT 2008


Hi Marc,

> void<unnamed>::PassRegistrar::RegisterPass(llvm::PassInfo&): Assertion 
> `Inserted && "Pass registered multiple times!"' failed.
This means you register your pass twice, ie you have the RegisterPass variable
in more than one compile unit.

> #include "../../Analysis/genome/GenomePass.cpp"
You shouldn't do this, assuming that GenomePass.cpp contains the
implementation for GenomePass, you will get it (and the associated
RegisterPass) compiled twice.

Instead, seperate your GenomePass.cpp into a .h file in the include/
directory, which contains the class declaration and a .cpp file which contains
method implementations and the RegisterPass variable. Then include the .h
file, including a .cpp file is almost always an error.

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080928/be2e5aee/attachment.sig>


More information about the llvm-dev mailing list