[PATCH] D157833: [C++20] [Coroutines] Mark await_suspend as noinline if the awaiter is not empty

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 18:51:33 PDT 2023


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


================
Comment at: clang/lib/CodeGen/CGCoroutine.cpp:169
+  // functions.
+  return !Awaiter->field_empty();
+}
----------------
rjmccall wrote:
> Is it possible for the awaiter type to be incomplete here?  That shouldn't be possible if the awaiter object is returned as an r-value, but as I understand it, you can also return a reference to an object, which would normally allow the type of that object to be incomplete.  But maybe that's disallowed due to higher-level rules with coroutines.
It is not possible since we need to make sure the awaiter has await_ready(), await_suspend() and await_resume member functions.


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

https://reviews.llvm.org/D157833



More information about the cfe-commits mailing list