================
@@ -50,6 +50,14 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, 
unsigned builtinID,
   }
 
   mlir::Location loc = getLoc(e->getExprLoc());
-  cgm.errorNYI(loc, "non constant foldable builtin calls");
+  switch (builtinID) {
+  case Builtin::BI__builtin_complex: {
+    mlir::Value real = emitScalarExpr(e->getArg(0));
+    mlir::Value imag = emitScalarExpr(e->getArg(1));
+    return RValue::getComplex(real, imag);
+  }
+  default:
+    cgm.errorNYI(loc, "non constant foldable builtin calls");
----------------
andykaylor wrote:

I'd like to see this, along with the code on line 52, remain with the 
`getUndefRValue` on line 62. They're all part of the same logic to report and 
unhandled builtin.

https://github.com/llvm/llvm-project/pull/144225
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to