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) {
-
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
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.
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
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
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
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:
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