Skip to content

Commit 3c0a064

Browse files
committed
use Type instead of TypeAttr
1 parent 6f0ff78 commit 3c0a064

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mlir/include/mlir/Dialect/Polynomial/IR/PolynomialAttributes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def Polynomial_RingAttr : Polynomial_Attr<"Ring", "ring"> {
6464
}];
6565

6666
let parameters = (ins
67-
Builtin_TypeAttr: $coefficientType,
67+
"Type": $coefficientType,
6868
OptionalParameter<"IntegerAttr">: $coefficientModulus,
6969
OptionalParameter<"PolynomialAttr">: $polynomialModulus
7070
);

mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ Attribute RingAttr::parse(AsmParser &parser, Type type) {
160160
if (failed(parser.parseEqual()))
161161
return {};
162162

163-
TypeAttr typeAttr;
164-
if (failed(parser.parseAttribute<TypeAttr>(typeAttr)))
163+
Type ty;
164+
if (failed(parser.parseType(ty)))
165165
return {};
166166

167167
if (failed(parser.parseComma()))
@@ -172,7 +172,7 @@ Attribute RingAttr::parse(AsmParser &parser, Type type) {
172172
if (failed(parser.parseEqual()))
173173
return {};
174174

175-
IntegerType iType = typeAttr.getValue().dyn_cast<IntegerType>();
175+
IntegerType iType = ty.dyn_cast<IntegerType>();
176176
if (!iType) {
177177
parser.emitError(parser.getCurrentLocation(),
178178
"coefficientType must specify an integer type");
@@ -205,7 +205,7 @@ Attribute RingAttr::parse(AsmParser &parser, Type type) {
205205
if (failed(parser.parseGreater()))
206206
return {};
207207

208-
return RingAttr::get(parser.getContext(), typeAttr, coefficientModulusAttr,
208+
return RingAttr::get(parser.getContext(), ty, coefficientModulusAttr,
209209
polyAttr);
210210
}
211211

0 commit comments

Comments
 (0)