to) whether the entity is an array, its size, or what type it has.
}];
- let parameters = (ins "mlir::Type":$eleTy, "mlir::AffineMapAttr":$map);
+ let parameters = (ins "mlir::Type":$eleTy);
let skipDefaultBuilders = 1;
let builders = [
TypeBuilderWithInferredContext<(ins
- "mlir::Type":$eleTy,
- CArg<"mlir::AffineMapAttr", "{}">:$map), [{
- return Base::get(eleTy.getContext(), eleTy, map);
+ "mlir::Type":$eleTy), [{
+ return Base::get(eleTy.getContext(), eleTy);
}]>,
];
let extraClassDeclaration = [{
mlir::Type getElementType() const { return getEleTy(); }
- mlir::AffineMapAttr getLayoutMap() const { return getMap(); }
}];
let genVerifyDecl = 1;
- let hasCustomAssemblyFormat = 1;
+
+ let assemblyFormat = "`<` $eleTy `>`";
}
def fir_CharacterType : FIR_Type<"Character", "char"> {
// BoxType
//===----------------------------------------------------------------------===//
-// `box` `<` type (',' affine-map)? `>`
-mlir::Type fir::BoxType::parse(mlir::AsmParser &parser) {
- mlir::Type ofTy;
- if (parser.parseLess() || parser.parseType(ofTy))
- return {};
-
- mlir::AffineMapAttr map;
- if (!parser.parseOptionalComma()) {
- if (parser.parseAttribute(map)) {
- parser.emitError(parser.getCurrentLocation(), "expected affine map");
- return {};
- }
- }
- if (parser.parseGreater())
- return {};
- return get(ofTy, map);
-}
-
-void fir::BoxType::print(mlir::AsmPrinter &printer) const {
- printer << "<" << getEleTy();
- if (auto map = getLayoutMap()) {
- printer << ", " << map;
- }
- printer << '>';
-}
-
mlir::LogicalResult
fir::BoxType::verify(llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
- mlir::Type eleTy, mlir::AffineMapAttr map) {
+ mlir::Type eleTy) {
// TODO
return mlir::success();
}
// -----
-// expected-error@+2 {{expected attribute value}}
-// expected-error@+1 {{expected affine map}}
-func.func private @box1() -> !fir.box<!fir.array<?xf32>, >
-
-// -----
-
-// expected-error@+1 {{expected non-function type}}
+// expected-error@+2 {{expected non-function type}}
+// expected-error@+1 {{failed to parse fir_BoxType parameter 'eleTy' which is to be a `mlir::Type`}}
func.func private @box1() -> !fir.box<>
// -----