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

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 8 00:39:49 PST 2021


ChuanqiXu marked 2 inline comments as done.
ChuanqiXu added inline comments.


================
Comment at: llvm/docs/Coroutines.rst:1395
+|            | Landingpad  | mark coroutine as done | mark coroutine done           |
++------------+-------------+------------------------+-------------------------------+
 
----------------
Maybe I need to explain why it would work in start (ramp) function. Generally, the ramp function is very small. But in case the initial_suspend of the coroutine wouldn't always suspend, the start function could be as large as the original function. In this case, it should remain the original semantics.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroSplit.cpp:304
+        Shape.FrameTy->getTypeAtIndex(coro::Shape::SwitchFieldIndex::Resume)));
+    Builder.CreateStore(NullPtr, GepIndex);
     if (!InResume)
----------------
rjmccall wrote:
> We need to do this store elsewhere, right, like during final suspends?  Can we make a common function for it?
I am not sure if I understand your point. I think the place where the `coro.end` lives should be the right place. The common function is made.


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

https://reviews.llvm.org/D115219



More information about the cfe-commits mailing list