[PATCH] D31646: [coroutines] Build GRO declaration and return GRO statement

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 11:15:00 PDT 2017


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Sema/AnalysisBasedWarnings.cpp:338
+  // In a coroutine, only co_return statements count as normal returns. Remember
+  // if we are processing the coroutine or not.
+  const bool IsCoroutine = isa<CoroutineBodyStmt>(AC.getBody());
----------------
the -> a


================
Comment at: lib/Sema/SemaCoroutine.cpp:1079-1083
+  // FIXME: ActOnReturnStmt expects a scope that is inside of the function, due
+  //   to CheckJumpOutOfSEHFinally(*this, ReturnLoc, *CurScope->getFnParent());
+  //   S.getCurScope()->getFnParent() == nullptr at ActOnFinishFunctionBody when
+  //   CoroutineBodyStmt is built. Figure it out and fix it.
+  //   Use BuildReturnStmt here to unbreak sanitized tests. (Gor:3/27/2017)
----------------
I'm not sure you need this FIXME; using `BuildReturnStmt` here instead of `ActOnReturnStmt` to skip the checks that we apply to parsed return statements but not instantiated return statements seems appropriate to me, so there's probably nothing to fix.


https://reviews.llvm.org/D31646





More information about the cfe-commits mailing list