This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow check
ClosedPublic

Authored by lxfind on Jun 23 2020, 3:09 PM.

Details

Summary

In https://reviews.llvm.org/D82029 we added the conformance check that the expression co_await promise.final_suspend() should not potentially throw.
As part of this expression, in cases when the await_suspend() method of the final suspend awaiter returns a handle, builtin_coro_resume could be called on the handle to immediately resume that coroutine.
builtin_coro_resume is not declared with noexcept and it shouldn't. We need to special check this case here.

Diff Detail

Event Timeline

lxfind created this revision.Jun 23 2020, 3:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2020, 3:09 PM
lxfind requested review of this revision.Jun 23 2020, 3:09 PM
lxfind updated this revision to Diff 272905.Jun 23 2020, 8:17 PM

Address lint

lewissbaker accepted this revision.Jun 25 2020, 10:19 AM

LGTM

clang/lib/Sema/SemaCoroutine.cpp
621

... it does not throw _into_ the coroutine that just suspended, but rather throws back out from whoever called coroutine_handle::resume().

This revision is now accepted and ready to land.Jun 25 2020, 10:19 AM
This revision was automatically updated to reflect the committed changes.
lxfind marked an inline comment as done.