[clang] Extend `retcon.once` coroutines lowering to optionally produce a normal result (PR #66333)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 14 02:11:15 PDT 2023


https://github.com/ChuanqiXu9 commented:

> One of the main user of these kind of coroutines is swift. There yield-once (retcon.once) coroutines are used to temporary "expose" pointers to internal fields of various objects creating borrow scopes.
>
> However, in some cases it might be useful also to allow these coroutines to produce a normal result, however, there is no way to represent this (as compared to switched-resume kind of coroutines where C++ co_return is transformed to a member / callback call on promise object).

Out of curiousity, why don't we  have the problem in the normal return continuation ABI?

https://github.com/llvm/llvm-project/pull/66333


More information about the cfe-commits mailing list