[PATCH] Implement CapturedStmt AST

Wei Pan wei.pan at intel.com
Wed Feb 20 12:10:44 PST 2013


  The patch enabling "pragma __debug captured" was posted already

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

  Our parsing and sema patches will be posted soon.

  Thanks a lot for reviewing!


================
Comment at: include/clang/AST/Stmt.h:1962
@@ +1961,3 @@
+  /// \brief The implicit outlined function.
+  FunctionDecl *TheFuncDecl;
+
----------------
Doug Gregor wrote:
> Interesting. We're actually going to synthesize a FunctionDecl for captured statements? I would have expected that the function would be synthesized entirely in CodeGen, and would never be represented in the AST. Why do we need to represent the function in the AST?
This FunctionDecl was synthesized during Sema and we marked this function as a capturing region. With this approach, its codegen seems simpler, comparing to the implementation for "CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo)" 

What about we first post our parsing and sema patches? If having this FunctionDecl is not ideal, we would certainly like to remove it out of the AST and generate it during CodeGen.   


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



More information about the cfe-commits mailing list