[cfe-dev] A plugin proposal for clang

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Mon Oct 17 06:50:42 PDT 2011


> 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.

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



More information about the cfe-dev mailing list