================ @@ -5097,6 +5099,22 @@ class CoroutineSuspendExpr : public Expr { return static_cast<Expr *>(SubExprs[SubExpr::Operand]); } + SuspendReturnType getSuspendReturnType() const { + auto *SuspendExpr = getSuspendExpr(); + assert(SuspendExpr); + + auto SuspendType = SuspendExpr->getType(); + + if (SuspendType->isVoidType()) + return SuspendReturnType::SuspendVoid; + if (SuspendType->isBooleanType()) + return SuspendReturnType::SuspendBool; + if (SuspendType->isVoidPointerType()) + return SuspendReturnType::SuspendHandle; + + llvm_unreachable("Unexpected await_suspend expression return type"); ---------------- ChuanqiXu9 wrote:
```suggestion return SuspendReturnType::SuspendHandle; ``` the `void pointer type` part looks odd. https://github.com/llvm/llvm-project/pull/79712 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits