On Tue, Jul 9, 2013 at 8:01 PM, James Dennett <[email protected]> wrote:
> jdennett added you to the CC list for the revision "Add a hook 
> RecursiveASTVisitor::TraverseLambdaBody.".
>
> Hi rsmith,
>
> Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to 
> use/maintain additional state from the LambdaExpr while visiting the body of 
> a LambdaExpr.
>
> One use for this arises because Clang's AST currently holds lambda bodies in 
> a form prior to their adjustment to refer to captured copies of local 
> variables, and so some clients will need access to the lambda's closure type 
> in order to query how to map VarDecl*s to the FieldDecls of their by-copy 
> captures.  This hook is sufficient for at least one such client; to do this 
> without such a hook would require the client to re-implement the whole of 
> TraverseLambdaExpr, which is non-trivial and would likely be more brittle.

I'm not sure I see the point; you can already override
TraverseLambdaCapture, or override TraverseLambdaExpr and have your
implementation call into the base class implementation.

-Eli

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to