@@ -61,11 +61,11 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
6161
6262 mlir::Value getConstAPInt (mlir::Location loc, mlir::Type typ,
6363 const llvm::APInt &val) {
64- return create<cir::ConstantOp>(loc, typ, getAttr<cir::IntAttr>(typ, val));
64+ return create<cir::ConstantOp>(loc, getAttr<cir::IntAttr>(typ, val));
6565 }
6666
6767 cir::ConstantOp getConstant (mlir::Location loc, mlir::TypedAttr attr) {
68- return create<cir::ConstantOp>(loc, attr. getType (), attr );
68+ return create<cir::ConstantOp>(loc, attr);
6969 }
7070
7171 cir::ConstantOp getConstantInt (mlir::Location loc, mlir::Type ty,
@@ -83,21 +83,17 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
8383 return getConstPtrAttr (t, 0 );
8484 }
8585
86- mlir::TypedAttr getZeroAttr (mlir::Type t) {
87- return cir::ZeroAttr::get (getContext (), t);
88- }
89-
9086 mlir::TypedAttr getZeroInitAttr (mlir::Type ty) {
9187 if (mlir::isa<cir::IntType>(ty))
9288 return cir::IntAttr::get (ty, 0 );
9389 if (cir::isAnyFloatingPointType (ty))
9490 return cir::FPAttr::getZero (ty);
9591 if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
96- return getZeroAttr (arrTy);
92+ return cir::ZeroAttr::get (arrTy);
9793 if (auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
9894 return getConstNullPtrAttr (ptrTy);
9995 if (auto recordTy = mlir::dyn_cast<cir::RecordType>(ty))
100- return getZeroAttr (recordTy);
96+ return cir::ZeroAttr::get (recordTy);
10197 if (mlir::isa<cir::BoolType>(ty)) {
10298 return getFalseAttr ();
10399 }
0 commit comments