[cfe-dev] Modify AST using libclang

Manasij Mukherjee manasij7479 at gmail.com
Fri Apr 17 12:45:34 PDT 2015


It is not a good idea to modify the AST.
If you can get away with rewriting the source instead, do that.

However if you must mutate the AST, derive a class from the required Decl
class.
You can then access many protected attributes directly.


On Fri, Apr 17, 2015 at 11:26 PM, Bernardo Rufino <bermonruf at gmail.com>
wrote:

> Hi,
>
> Is there a way to modify the AST using libclang and then write it back to
> .ast? I couldn't find any methods to actually modify it, just to traverse
> and inspect.
>
> Thanks,
> --
> Bernardo Rufino
> bernardorufino.com.br <http://www.bernardorufino.com.br/>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150418/f5593ce1/attachment.html>


More information about the cfe-dev mailing list