[clang] [ClangIR] Support bool-returning await_suspend (PR #227527)
Aman Maurya via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 13 05:14:18 PDT 2026
================
@@ -5331,12 +5333,25 @@ def CIR_CoroSuspendPoint : CIR_Op<"coro.suspend_point", [
- destroy: transfers through the enclosing `cir.cleanup.scope`s to the
`cir.coroutine`'s `destroy` region when the coroutine handle is
destroyed.
+
+ When the optional `cond` operand is present, a `false` value vetoes the
+ suspension and control branches directly to the `resume` region of the
+ enclosing `cir.await`. A `true` value indicates the coroutine actually
+ suspends.
}];
+ let arguments = (ins Optional<CIR_AnyBoolType>:$cond);
----------------
amanmaurya92 wrote:
Great ideas, thank you! I'll tackle both in a follow-up PR.
https://github.com/llvm/llvm-project/pull/227527
More information about the cfe-commits
mailing list