[libcxx-commits] [clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

Chuanqi Xu via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 18 23:50:33 PDT 2025


================
@@ -5288,13 +5290,22 @@ class CoroutineSuspendExpr : public Expr {
   }
 
   CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) {
+    CoroutineSuspendExprBits.UseAwaitSuspendDestroy = false;
     SubExprs[SubExpr::Operand] = nullptr;
     SubExprs[SubExpr::Common] = nullptr;
     SubExprs[SubExpr::Ready] = nullptr;
     SubExprs[SubExpr::Suspend] = nullptr;
     SubExprs[SubExpr::Resume] = nullptr;
   }
 
+  bool useAwaitSuspendDestroy() const {
+    return CoroutineSuspendExprBits.UseAwaitSuspendDestroy;
+  }
+
+  void setUseAwaitSuspendDestroy(bool Use) {
----------------
ChuanqiXu9 wrote:

nit
```suggestion
  void setUseAwaitSuspendDestroy(bool Use = true) {
```

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


More information about the libcxx-commits mailing list