[clang] [CIR] Add cir.coro.suspend intrinsic (PR #228310)

Morris Hafner via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 08:50:35 PDT 2026


================
@@ -1826,8 +1826,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
   case Builtin::BI__builtin_coro_done:
     return RValue::get(emitCoroDoneBuiltinCall(e).getResult());
   case Builtin::BI__builtin_coro_suspend:
-    cgm.errorNYI(e->getSourceRange(), "BI__builtin_coro_suspend NYI");
-    return getUndefRValue(e->getType());
+    return RValue::get(emitCoroSuspendBuiltinCall(e).getResult());
----------------
mmha wrote:

```suggestion
  mlir::Value result = emitCoroSuspendBuiltinCall(e).getResult();
  return RValue::get(builder.createIntCast(result, convertType(e->getType())));
```

This breaks on ARM, where `char` (the builtins return type) is unsigned. You need to cast here.

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


More information about the cfe-commits mailing list