================
@@ -449,10 +449,16 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl 
&gd, unsigned builtinID,
   }
   case Builtin::BI__builtin_coro_free:
   case Builtin::BI__builtin_coro_size: {
-    cgm.errorNYI(e->getSourceRange(),
-                 "BI__builtin_coro_free, BI__builtin_coro_size NYI");
-    assert(!cir::MissingFeatures::coroSizeBuiltinCall());
-    return getUndefRValue(e->getType());
+    GlobalDecl gd{fd};
+    mlir::Type ty = cgm.getTypes().getFunctionType(
+        cgm.getTypes().arrangeGlobalDeclaration(gd));
+    const auto *nd = cast<NamedDecl>(gd.getDecl());
+    cir::FuncOp fnOp =
+        cgm.getOrCreateCIRFunction(nd->getName(), ty, gd, /*ForVTable=*/false,
+                                   /*DontDefer=*/false);
----------------
andykaylor wrote:

```suggestion
        cgm.getOrCreateCIRFunction(nd->getName(), ty, gd, /*forVTable=*/false);
```
`dontDefer` defaults to false. Unless there is a reason to specifically show it 
here, it can be omitted. I'm not sure why `forVTable` doesn't also default to 
false. I don't think that's common. I only see one place in the incubator where 
it is called with true.

https://github.com/llvm/llvm-project/pull/164180
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to