[clang] [CIR] Add token.none and fix coro.end signature (PR #214125)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 9 15:40:22 PDT 2026
================
@@ -1388,7 +1388,8 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
return coroBeg ? RValue::get(coroBeg.getResult())
: getUndefRValue(e->getType());
}
-
+ case Builtin::BI__builtin_coro_end:
+ return RValue::get(emitCoroEndBuiltinCall(e).getResultToken());
----------------
Andres-Salamanca wrote:
Thanks for catching this! I think this is not quite right, though. `llvm.coro.end` actually returns `void`, as you can see in the https://llvm.org/docs/Coroutines.html#llvm-coro-end-intrinsic and in [`Intrinsics.td`](https://github.com/llvm/llvm-project/blob/8f695805904edad671892e624a4ada4031f3da1e/llvm/include/llvm/IR/Intrinsics.td#L1994). I changed it to `(outs CIR_AnyVoidType:$result)` so it can return a value and `RValue::get()` can use it.
https://github.com/llvm/llvm-project/pull/214125
More information about the cfe-commits
mailing list