[cfe-dev] A plugin proposal for clang

Konstantin Tokarev annulen at yandex.ru
Thu Oct 20 02:59:57 PDT 2011



20.10.2011, 11:44, "Erik Verbruggen" <erik.verbruggen at me.com>:
> On 19-10-11 20:03, Joshua Cranmer wrote:
>
>>  On 10/17/2011 1:12 PM, Douglas Gregor wrote:
>>>  On Oct 14, 2011, at 5:31 PM, Joshua Cranmer wrote:
>>  Effectively, an example of how to do LLVM optimization passes via a
>>  clang plugin.
>>>  One useful example would be to add an "annotate" attribute to various
>>>  declarations, and verify that the attribute made it through to the IR.
>>>
>>>  I think it's useful to categorize the various existing and intended
>>>  extension points for a plugin interface. ASTConsumer and PPCallbacks
>>>  come to mind immediately, but what else?
>>  Diagnostics (so plugins can add warnings/errors) come to mind quickly as
>>  well. I can imagine that some clever people might need to know about
>>  some specific codegen details if they are using plugins to generate
>>  reflective metadata; everything else I can think of is more or less
>>  covered by LLVM.
>
> Being able to generate new chunks of AST would also be helpful. That
> would make it possible to turn source-code generators into plug-ins that
> generate AST on the fly, without needing to generate code.

..and rewrite chunks of old AST before it gets into CodeGen.

-- 
Regards,
Konstantin



More information about the cfe-dev mailing list