<div dir="ltr">I was attempting to extend this Rewriter example:<div><br></div><div><a href="http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/">http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/</a></div>
<div><br></div><div>to transform function or macro calls from one to another.  Example</div><div><br></div><div>foo( a, b ) -> bar ( b ) </div><div><br></div><div>Using a VisitCallExpr() I can get as far as finding the name of the function, seeing if it's foo, and finding all the args, but it's not obvious to me how to hook this into the rewriter, replacing args and changing the function name.</div>
<div><br></div><div>Are there any full examples available for this sort of task?   Since this is probably the most obvious application of Rewriter and ASTvisitor, I'm sure this has been done a bunch of times.<br clear="all">
<div><br></div>-- <br>Peeter
</div></div>