[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 5 11:46:03 PDT 2025


================
@@ -201,6 +201,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
   cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; }
   cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; }
 
+  cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal);
+
+  cir::ConstantOp getConstInt(mlir::Location loc, llvm::APInt intVal);
+
+  cir::ConstantOp getConstInt(mlir::Location loc, mlir::Type t, uint64_t c);
+
+  cir::ConstantOp getConstFP(mlir::Location loc, mlir::Type t,
+                             llvm::APFloat fpVal) {
+    assert((mlir::isa<cir::SingleType, cir::DoubleType>(t)) &&
----------------
andykaylor wrote:

This doesn't seem like a good assumption, and it's crashing the incubator in this case: https://godbolt.org/z/Ycv1Gv7Y1.

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


More information about the cfe-commits mailing list