[llvm] [clang] [Coroutines] Introduce [[clang::coro_only_destroy_when_complete]] (PR #71014)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 2 05:57:43 PDT 2023


================
@@ -777,6 +777,12 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
 
   // LLVM require the frontend to mark the coroutine.
   CurFn->setPresplitCoroutine();
+
+  {
+    CXXRecordDecl *RD = FnRetTy->getAsCXXRecordDecl();
+    if (RD && RD->hasAttr<CoroOnlyDestroyWhenCompleteAttr>())
+      CurFn->setCoroDestroyOnlyWhenDone();
+  }
----------------
ChuanqiXu9 wrote:

Got it. Thanks. Will do in the next round or landing.

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


More information about the cfe-commits mailing list