[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-04 Thread Brian Gesiak via Phabricator via cfe-commits
modocache added a comment. Thanks again for all the reviews, @GorNishanov! Very much appreciated. Comment at: lib/CodeGen/CGCoroutine.cpp:220 CGF.EmitBlock(ReadyBlock); + CXXTryStmt *TryStmt = nullptr; + if (Coro.ExceptionHandler && Kind == AwaitKind::Init) { -

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-04 Thread Brian Gesiak via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331519: [Coroutines] Catch exceptions in await_resume (authored by modocache, committed by ). Changed prior to commit: https://reviews.llvm.org/D45860?vs=144961&id=145188#toc Repository: rC Clang ht

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-03 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov accepted this revision. GorNishanov added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang https://reviews.llvm.org/D45860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-02 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 144961. modocache added a comment. Oops, thanks for testing on release mode, @GorNishanov. Turns out I had a dangling pointer. With this update the tests pass on both release and debug. Repository: rC Clang https://reviews.llvm.org/D45860 Files: lib

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-02 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added a comment. Looks good. Make sure to run the tests in release and debug mode. On my box, these three test failed in release mode. Clang :: CodeGenCoroutines/coro-await-resume-eh.cpp Clang :: CodeGenCoroutines/coro-promise-dtor.cpp Clang :: CodeGenCoroutines/coro-unhandled-e

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-05-02 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 144908. modocache added a comment. Thanks for the review, @GorNishanov. Here's a more correct solution: an i1 is used to keep track of whether await_resume threw. If it did, the coroutine body is skipped, and we go straight to the final suspend point. Othe

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-04-25 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added a comment. Thank you for doing this. It looks very elegant, but, it is a little bit wrong. It creates two different initial_suspend objects. Run this example: https://wandbox.org/permlink/Q1Zd2NUlolmw9YmX You will observe that in trunk we are getting the output: 0x216808c:

[PATCH] D45860: [Coroutines] Catch exceptions in await_resume

2018-04-19 Thread Brian Gesiak via Phabricator via cfe-commits
modocache created this revision. modocache added reviewers: GorNishanov, EricWF. http://wg21.link/P0664r2 section "Evolution/Core Issues 24" describes a proposed change to Coroutines TS that would have any exceptions thrown after the initial suspend point of a coroutine be caught by the handler sp