[cfe-dev] About AST rewriting / manipulation

Ben Laurie benl at google.com
Tue Feb 3 10:40:10 PST 2009


On Tue, Feb 3, 2009 at 10:37 AM, Ben Laurie <benl at google.com> wrote:
> For the above you would match something like "f(@a, @b)" and output
> something like "g(@b, @a, c)".

BTW, I should add a warning here - in Javascript this would break
evaluation order guarantees - I can't remember for sure if "," is a
sequence point (is that the right term?) in C, but if it is you'd have
to rewrite to something like "t1 = @a; t2 = @b; g(t2, t1, c)" to
preserve order.



More information about the cfe-dev mailing list