@@ -133,25 +133,21 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
133
133
134
134
cir::BoolAttr getFalseAttr () { return getCIRBoolAttr (false ); }
135
135
136
- mlir::TypedAttr getZeroAttr (mlir::Type t) {
137
- return cir::ZeroAttr::get (getContext (), t);
138
- }
139
-
140
136
mlir::TypedAttr getZeroInitAttr (mlir::Type ty) {
141
137
if (mlir::isa<cir::IntType>(ty))
142
138
return cir::IntAttr::get (ty, 0 );
143
139
if (cir::isAnyFloatingPointType (ty))
144
140
return cir::FPAttr::getZero (ty);
145
141
if (auto complexType = mlir::dyn_cast<cir::ComplexType>(ty))
146
- return getZeroAttr (complexType);
142
+ return cir::ZeroAttr::get (complexType);
147
143
if (auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
148
- return getZeroAttr (arrTy);
144
+ return cir::ZeroAttr::get (arrTy);
149
145
if (auto vecTy = mlir::dyn_cast<cir::VectorType>(ty))
150
- return getZeroAttr (vecTy);
146
+ return cir::ZeroAttr::get (vecTy);
151
147
if (auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
152
148
return getConstNullPtrAttr (ptrTy);
153
149
if (auto RecordTy = mlir::dyn_cast<cir::RecordType>(ty))
154
- return getZeroAttr (RecordTy);
150
+ return cir::ZeroAttr::get (RecordTy);
155
151
if (auto methodTy = mlir::dyn_cast<cir::MethodType>(ty))
156
152
return getNullMethodAttr (methodTy);
157
153
if (mlir::isa<cir::BoolType>(ty)) {
0 commit comments