forked from OSchip/llvm-project
[flang] Remove unused AffineMapAttr from fir.box type
AffineMapAttr on fir.box type is not used. This patch remove it. It can be added back later when needed. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D134955
This commit is contained in:
parent
e23aee7175
commit
e8b701208c
|
@ -75,25 +75,24 @@ def fir_BoxType : FIR_Type<"Box", "box"> {
|
|||
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"> {
|
||||
|
|
|
@ -377,35 +377,9 @@ static bool cannotBePointerOrHeapElementType(mlir::Type eleTy) {
|
|||
// 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();
|
||||
}
|
||||
|
|
|
@ -6,13 +6,8 @@ func.func private @box3() -> !fir.boxproc<>
|
|||
|
||||
// -----
|
||||
|
||||
// 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<>
|
||||
|
||||
// -----
|
||||
|
|
Loading…
Reference in New Issue