[PATCH] D23204: Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().

Martin Böhme via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 15 23:50:08 PDT 2016


mboehme marked 2 inline comments as done.

================
Comment at: include/clang/AST/RecursiveASTVisitor.h:892
@@ -891,1 +891,3 @@
+  else
+    TRY_TO(TraverseStmt(LE->capture_init_begin()[C - LE->capture_begin()]));
   return true;
----------------
klimek wrote:
> I'd rather pass in the offset than doing math with what's semantically a pointer vs an iterator.
I think the cleanest way to do this would be to pass in both the LambdaCapture and the Expr for the corresponding initialization (and handle the offsets in TraverseLambdaExpr).

This will first require transitioning all users of TraverseLambdaCapture to the new interface, which I'll do in a separate patch.

================
Comment at: include/clang/AST/RecursiveASTVisitor.h:895
@@ -891,1 +894,3 @@
+  else
+    TRY_TO(TraverseStmt(Init));
   return true;
----------------
I've now decided to do the interface change for TraverseLambdaCapture in this same patch.

There are a few users of TraverseLambdaCapture in clang-tools-extra; the required changes are in D23543. The intent is to wait until the reviews for both patches are complete, then submit them at the same time.


https://reviews.llvm.org/D23204





More information about the cfe-commits mailing list