[clang] [CIR] Emit CIR builtins: coroAlloc, coroBegin, and coroSize (PR #164180)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 24 12:49:19 PDT 2025


================
@@ -63,6 +67,48 @@ cir::CallOp CIRGenFunction::emitCoroIDBuiltinCall(mlir::Location loc,
                                                nullPtr, nullPtr, nullPtr});
 }
 
+cir::CallOp CIRGenFunction::emitCoroAllocBuiltinCall(mlir::Location loc) {
+  cir::BoolType boolTy = builder.getBoolTy();
+  cir::IntType int32Ty = builder.getUInt32Ty();
+
+  mlir::Operation *builtin = cgm.getGlobalValue(cgm.builtinCoroAlloc);
+
+  cir::FuncOp fnOp;
+  if (!builtin) {
+    fnOp = cgm.createCIRBuiltinFunction(loc, cgm.builtinCoroAlloc,
+                                        cir::FuncType::get({int32Ty}, boolTy),
+                                        /*FD=*/nullptr);
----------------
Andres-Salamanca wrote:

Done

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


More information about the cfe-commits mailing list