How tor traverse an return expr?

Hi everyone,

inside a FunctionDecl I have a return statement like e.g.

     return 1 + foo(p1,p2) * 2;

and I want to transform this into something like

/*1*/ temp = foo(p1,p2,p3);

/*2*/ return 1 + foo(p1,p2,p3) * 2;

How can I iterate over the return Expr to rewrite the call to foo?

The case /*2*/ is working fine with the use of a VisitCallExpr method.

The case /*1*/ is generated by using a rewriter and the rewriter does

not know about the /*2*/ transformation.