[cfe-dev] Mutable AST -- Advice Needed --

Sean Silva silvas at purdue.edu
Tue May 28 20:27:14 PDT 2013


On Tue, May 28, 2013 at 11:42 AM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Tue, May 28, 2013 at 11:31 AM, steveneliuk <s.eliuk at samsung.com> wrote:
>
>> Clang parses and constructs an AST quickly & effectively... likewise
>> provides
>> wonderful tools for traversing the AST with ease. Utilizing these tools
>> provides a lot of the functionality required in the WebCL validator
>>
>> Matchers provide a nice way to quickly navigate to nodes of interest, but
>> the modifications and consistency of the AST is not achievable through
>> matchers.
>>
>
> Consistency of the AST is significantly harder to achieve through direct
> AST manipulation than through source rewriting. There are various forms of
> implicitly-added AST nodes that you would need to create, and you would
> need to ensure that your nodes have appropriate type, value kind, and so
> on. None of this is necessary if you use the rewrite interface.
>
>
This kind of transformation may be tractable for the subset of C-like
language constructs that OpenCL/WebCL needs (i.e., not needing to deal with
the full generality of C++).

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130528/280aab78/attachment.html>


More information about the cfe-dev mailing list