[cfe-dev] Failure to rewrite code using clang plugin

John Brawn via cfe-dev cfe-dev at lists.llvm.org
Tue May 3 10:09:52 PDT 2016


A PluginASTAction can define a getActionType method to say when the plugin
action is used: before, after, or instead of the main AST action. See
clang/examples/AnnotateFunctions for an example.

John

> -----Original Message-----
> From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of
> Miklos Vajna via cfe-dev
> Sent: 03 May 2016 17:37
> To: Pablo Oliva
> Cc: cfe-dev at lists.llvm.org
> Subject: Re: [cfe-dev] Failure to rewrite code using clang plugin
> 
> On Tue, May 03, 2016 at 12:08:55PM -0300, Pablo Oliva
> <pablo.oliva at tallertechnologies.com> wrote:
> > What I want to do is to modify the source code (using a plugin) during
> > compilation, and then proceed with the compilation of the modified
> source
> > code. Is this possible?
> 
> Ah, I see. I've only seen that happening so far only in two passes:
> first a rewriter one, then a separate compiler invocation to actually
> compile the modified code.
> 
> But perhaps others managed to do that in one pass. :-)


More information about the cfe-dev mailing list