[PATCH] D115219: [C++20] [Coroutines] Mark coroutine done if unhandled_exception throws

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 23:48:19 PST 2021


rjmccall added a comment.

I agree that you shouldn't call `suspend`, but doesn't `coro.end` have the behavior of marking the coroutine done?  Should we just be calling `coro.end` on this path?



================
Comment at: llvm/docs/Coroutines.rst:1661
+should return true. All of the '``llvm.coro.mark.done``' would be lowered in CoroSplit pass.
+This intrinsic is only supported for switched-resume coroutines.
+
----------------
"The '``llvm.coro.mark.done``' intrinsic marks that the current coroutine is complete. '``llvm.coro.mark.done``' is lowered during coroutine splitting and must not appear outside of an unsplit coroutine.  This intrinsic is only supported for switched-resume coroutines."


================
Comment at: llvm/docs/Coroutines.rst:1668
+the coroutines in LLVM wouldn't be inlined before splitted. So there is no ambiguousity about the
+coroutine that the '``llvm.coro.mark.done``' refers to.
+
----------------
"'``llvm.coro.mark.done``' doesn't require any arguments.  There is no ambiguity about which coroutine is meant because unsplit coroutines in LLVM cannot be broken up or inlined."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115219/new/

https://reviews.llvm.org/D115219



More information about the llvm-commits mailing list