[PATCH] D28835: [coroutines] NFC: Refactor Sema::CoroutineBodyStmt construction.

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 11:38:06 PST 2017


rsmith added a comment.

Generally looks good, but we have a better way of modeling types with a trailing variable-length array that you should use.



================
Comment at: include/clang/AST/StmtCXX.h:299
 /// down the coroutine frame.
 class CoroutineBodyStmt : public Stmt {
   enum SubStmt {
----------------
Please use `llvm::TrailingObjects` to store the trailing variable-length `SubStmts` array.


================
Comment at: lib/Sema/SemaCoroutine.cpp:714-722
+// Try to form 'p.set_exception(std::current_exception());' to handle
+// uncaught exceptions.
+// TODO: Post WG21 Issaquah 2016 renamed set_exception to unhandled_exception
+// TODO: and dropped exception_ptr parameter. Make it so.
+
+  if (!PromiseRecordDecl)
+    return true;
----------------
Reindent comments.


https://reviews.llvm.org/D28835





More information about the cfe-commits mailing list