[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:32:42 PDT 2026


================
@@ -274,11 +274,16 @@ cir::CoroBeginOp CIRGenFunction::emitCoroBeginBuiltinCall(const CallExpr *e) {
   return coroBegin;
 }
 
-cir::CoroEndOp CIRGenFunction::emitCoroEndBuiltinCall(mlir::Location loc,
-                                                      mlir::Value nullPtr) {
-  return cir::CoroEndOp::create(
-      cgm.getBuilder(), loc,
-      mlir::ValueRange{nullPtr, builder.getBool(false, loc)});
+cir::CoroEndOp CIRGenFunction::emitCoroEndBuiltinCall(const CallExpr *e) {
+
+  mlir::Location loc = getLoc(e->getBeginLoc());
+  CIRGenBuilderTy &builder = cgm.getBuilder();
+  llvm::SmallVector<mlir::Value, 3> args;
+  for (const Expr *arg : e->arguments())
+    args.push_back(emitScalarExpr(arg));
+  auto tkNone = cir::TokenNoneOp::create(builder, loc);
+  args.push_back(tkNone.getResult());
----------------
Andres-Salamanca wrote:

Done

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


More information about the cfe-commits mailing list