Multiple plug-ins in one shared lib?

Hello,

I could not find it back in the mailinglist archives, so: can I put multiple clang plug-ins into a single shared library? I tried to do that, but when I run it with:
   clang -cc1 -load libA.dylib -plugin B -plugin C test.cpp

.. then only the C plug-in (the last -plugin) is run. If this is not possible (yet?), is there another way to register multiple ASTConsumer/RecursiveASTVisitor classes from a PluginASTAction?

-- Erik.

Hi, Erik. AFAIK it's not yet possible to run multiple plugin actions from a single invocation of clang. This has nothing to do with where the actions come from; it's just how -plugin is handled.

Please file a bug at http://llvm.org/bugs with your expected behavior: do you want the plugins to be run serially on the original AST, or should they be able to return a new AST so they can act as filters of some kind, or...

(my guess is you just want the first one, but I thought I'd bring it up)

Jordy

-add-plugin supports multiple plugins, so you could pass the first
plugin through -plugin and the rest through to -add-plugin. (Or use
-add-plugin for all of them if you don't mind codegen running as
well.)

Nico