[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-27 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D25349#571778, @GorNishanov wrote: > @rsmith, I am wondering what were your thoughts on where to generate try { > body } catch (...) { p.set_exception(std::exceptio

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-17 Thread Gor Nishanov via cfe-commits
GorNishanov added a comment. @rsmith, I am wondering what were your thoughts on where to generate try { body } catch (...) { p.set_exception(std::exception()); } Would it be in SemaCoroutine.cpp? Essentially, add something like this: ` bool makeBody() { if (!OnException) ret

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Gor Nishanov via cfe-commits
GorNishanov added a comment. LGTM, but, will need to wait for @rsmith to sign off. https://reviews.llvm.org/D25349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Eric Fiselier via cfe-commits
EricWF added inline comments. > GorNishanov wrote in coreturn.cpp:36 > No need to hve yield_value here, unless you want to use co_yield expression > in the coroutine. In this file, we are using co_await only. (Same comment > for promise_float and promise_int) Ack. I'll add them back if I need

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Eric Fiselier via cfe-commits
EricWF updated this revision to Diff 73866. EricWF marked 2 inline comments as done. EricWF added a comment. Address review comments. https://reviews.llvm.org/D25349 Files: include/clang/AST/StmtCXX.h include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/AnalysisBasedWarnings.cpp lib/Sema

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread David Majnemer via cfe-commits
majnemer added inline comments. > AnalysisBasedWarnings.cpp:537 >if (const FunctionDecl *FD = dyn_cast(D)) { > -ReturnsVoid = FD->getReturnType()->isVoidType(); > +if (const CoroutineBodyStmt *CBody = dyn_cast(Body)) > + ReturnsVoid = CBody->getFallthroughHandler() != nullptr; `

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Gor Nishanov via cfe-commits
GorNishanov added a comment. shipit > coreturn.cpp:36 > + suspend_always final_suspend(); > + awaitable yield_value(int); > + void return_void(); No need to hve yield_value here, unless you want to use co_yield expression in the coroutine

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Eric Fiselier via cfe-commits
EricWF updated this revision to Diff 73862. EricWF added a comment. - Remove useless line of code. https://reviews.llvm.org/D25349 Files: include/clang/AST/StmtCXX.h include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/AnalysisBasedWarnings.cpp lib/Sema/SemaCoroutine.cpp lib/Sema/TreeT

[PATCH] D25349: [coroutines] Build fallthrough and set_exception statements.

2016-10-06 Thread Eric Fiselier via cfe-commits
EricWF created this revision. EricWF added reviewers: rsmith, GorNishanov, majnemer. EricWF added a subscriber: cfe-commits. Herald added a subscriber: mehdi_amini. This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::curre