[cfe-dev] RE : AST Transformation

Sebastian Redl sebastian.redl at getdesigned.at
Mon Apr 4 10:59:03 PDT 2011


On 04.04.2011, at 19:38, David Chisnall wrote:

> On 4 Apr 2011, at 17:27, Argyrios Kyrtzidis wrote:
> 
>>> A good project for someone interested in AST transforms would be a subclass of RecursiveASTVisitor that generated a copy of the AST by walking each node in turn and adding an equivalent node to a new AST. Users could then subclass this and use it to generate a new AST that differed from the original in only the specific ways that they desired.  
>> 
>> I think this is basically the functionality of TreeTransform, any effort should be directed at improving that one IMO.
> 
> I'd not noticed TreeTransform.  Is there a reason why its header is not public?  

I think it's because it was developed as an implementation detail of Sema, for the use of template instantiation and some other Sema-internal stuff, and has never been reviewed for suitability for public consumption.

Sebastian



More information about the cfe-dev mailing list