@@ -98,31 +98,31 @@ def HasValueSemanticsPred : CPred<"$_self.hasTrait<::mlir::ValueSemantics>()">;
98
98
99
99
// A type, carries type constraints.
100
100
class Type<Pred condition, string descr = "",
101
- string cppClassName = "::mlir::Type"> :
102
- TypeConstraint<condition, descr, cppClassName > {
101
+ string cppType = "::mlir::Type"> :
102
+ TypeConstraint<condition, descr, cppType > {
103
103
string description = "";
104
104
string builderCall = "";
105
105
}
106
106
107
107
// Allows providing an alternative name and summary to an existing type def.
108
108
class TypeAlias<Type t, string summary = t.summary> :
109
- Type<t.predicate, summary, t.cppClassName > {
109
+ Type<t.predicate, summary, t.cppType > {
110
110
let description = t.description;
111
111
let builderCall = t.builderCall;
112
112
}
113
113
114
114
// A type of a specific dialect.
115
115
class DialectType<Dialect d, Pred condition, string descr = "",
116
- string cppClassName = "::mlir::Type"> :
117
- Type<condition, descr, cppClassName > {
116
+ string cppType = "::mlir::Type"> :
117
+ Type<condition, descr, cppType > {
118
118
Dialect dialect = d;
119
119
}
120
120
121
121
// A variadic type constraint. It expands to zero or more of the base type. This
122
122
// class is used for supporting variadic operands/results.
123
123
class Variadic<Type type> : TypeConstraint<type.predicate,
124
124
"variadic of " # type.summary,
125
- type.cppClassName > {
125
+ type.cppType > {
126
126
Type baseType = type;
127
127
int minSize = 0;
128
128
}
@@ -140,7 +140,7 @@ class VariadicOfVariadic<Type type, string variadicSegmentAttrName>
140
140
// An optional type constraint. It expands to either zero or one of the base
141
141
// type. This class is used for supporting optional operands/results.
142
142
class Optional<Type type> : TypeConstraint<type.predicate, type.summary,
143
- type.cppClassName > {
143
+ type.cppType > {
144
144
Type baseType = type;
145
145
}
146
146
@@ -172,33 +172,33 @@ def NoneType : Type<CPred<"::llvm::isa<::mlir::NoneType>($_self)">, "none type",
172
172
173
173
// Any type from the given list
174
174
class AnyTypeOf<list<Type> allowedTypeList, string summary = "",
175
- string cppClassName = "::mlir::Type"> : Type<
175
+ string cppType = "::mlir::Type"> : Type<
176
176
// Satisfy any of the allowed types' conditions.
177
177
Or<!foreach(allowedtype, allowedTypeList, allowedtype.predicate)>,
178
178
!if(!eq(summary, ""),
179
179
!interleave(!foreach(t, allowedTypeList, t.summary), " or "),
180
180
summary),
181
- cppClassName > {
181
+ cppType > {
182
182
list<Type> allowedTypes = allowedTypeList;
183
183
}
184
184
185
185
// A type that satisfies the constraints of all given types.
186
186
class AllOfType<list<Type> allowedTypeList, string summary = "",
187
- string cppClassName = "::mlir::Type"> : Type<
187
+ string cppType = "::mlir::Type"> : Type<
188
188
// Satisfy all of the allowed types' conditions.
189
189
And<!foreach(allowedType, allowedTypeList, allowedType.predicate)>,
190
190
!if(!eq(summary, ""),
191
191
!interleave(!foreach(t, allowedTypeList, t.summary), " and "),
192
192
summary),
193
- cppClassName > {
193
+ cppType > {
194
194
list<Type> allowedTypes = allowedTypeList;
195
195
}
196
196
197
197
// A type that satisfies additional predicates.
198
198
class ConfinedType<Type type, list<Pred> predicates, string summary = "",
199
- string cppClassName = type.cppClassName > : Type<
199
+ string cppType = type.cppType > : Type<
200
200
And<!listconcat([type.predicate], !foreach(pred, predicates, pred))>,
201
- summary, cppClassName >;
201
+ summary, cppType >;
202
202
203
203
// Integer types.
204
204
@@ -375,23 +375,23 @@ def FunctionType : Type<CPred<"::llvm::isa<::mlir::FunctionType>($_self)">,
375
375
376
376
// A container type is a type that has another type embedded within it.
377
377
class ContainerType<Type etype, Pred containerPred, code elementTypeCall,
378
- string descr, string cppClassName = "::mlir::Type"> :
378
+ string descr, string cppType = "::mlir::Type"> :
379
379
// First, check the container predicate. Then, substitute the extracted
380
380
// element into the element type checker.
381
381
Type<And<[containerPred,
382
382
SubstLeaves<"$_self", !cast<string>(elementTypeCall),
383
383
etype.predicate>]>,
384
- descr # " of " # etype.summary # " values", cppClassName >;
384
+ descr # " of " # etype.summary # " values", cppType >;
385
385
386
386
class ShapedContainerType<list<Type> allowedTypes,
387
387
Pred containerPred, string descr,
388
- string cppClassName = "::mlir::Type"> :
388
+ string cppType = "::mlir::Type"> :
389
389
Type<And<[containerPred,
390
390
Concat<"[](::mlir::Type elementType) { return ",
391
391
SubstLeaves<"$_self", "elementType",
392
392
AnyTypeOf<allowedTypes>.predicate>,
393
393
"; }(::llvm::cast<::mlir::ShapedType>($_self).getElementType())">]>,
394
- descr # " of " # AnyTypeOf<allowedTypes>.summary # " values", cppClassName >;
394
+ descr # " of " # AnyTypeOf<allowedTypes>.summary # " values", cppType >;
395
395
396
396
// Whether a shaped type is ranked.
397
397
def HasRankPred : CPred<"::llvm::cast<::mlir::ShapedType>($_self).hasRank()">;
0 commit comments