[PATCH] Implement CapturedStmt AST

Doug Gregor dgregor at apple.com
Tue Feb 19 10:23:09 PST 2013


  A few minor comments, but the code that's here looks fine. However, it doesn't belong in the Clang tree until it does *something*. Let's get a basic captured statement parsing (with no capture yet, of course!) and building this AST.


================
Comment at: include/clang/AST/Stmt.h:1887
@@ -1884,1 +1886,3 @@
 
+/// \brief This captures a statement into a function.
+class CapturedStmt : public Stmt {
----------------
More detail, please. What does it mean to capture a statement into a function? What source code would result in a captured statement? 

================
Comment at: include/clang/AST/Stmt.h:1899
@@ +1898,3 @@
+    VarDecl *Var;
+    Expr *CopyExpr;
+
----------------
Because we only have 'this' and by-reference captures, there is no need for a CopyExpr. Please remove it; it can be reintroduced when it's needed (and it won't be a part of the stored Capture, since that doesn't work with children()).


http://llvm-reviews.chandlerc.com/D370



More information about the cfe-commits mailing list