[cfe-dev] A plugin proposal for clang

Philip Ashmore contact at philipashmore.com
Mon Oct 17 08:02:20 PDT 2011


On 17/10/11 14:50, Rafael Ávila de Espíndola wrote:
>> Instead I'd recommend an interface based approach, like COM.
>> The compiler driver looks up a registry when it needs to create anything,
>> and gets a factory object from which it creates instances.
>
> One good property to have is for puligns to use the same API as builtin
> code. That makes it easy to refactor code as a plugin or move in a
> plugin that was found to be really useful.
Isn't NaCl doing something like this?
>
> Given that, your proposal would mean that different parts of clang would
> use a COM like interface. Having seen a codebase that does something
> similar, I would say it is not worth it. It complicates the code and
> actually make code harder to factor as it moves compile time checks to
> runtime.
>
>> Philip
>
> Cheers,
> Rafael
>
I also liked the ability to do COM interception. This could let you see 
the call
sequence visually.

I hadn't thought of going the full scripting route - implementing plug ins
with scripting, which would definitely require runtime checks.

Philip



More information about the cfe-dev mailing list