operands attr-dict `:` functional-type(operands, results)
}];
- let verifier = [{
- auto size = extents().size();
- auto shapeTy = getType().dyn_cast<fir::ShapeType>();
- assert(shapeTy && "must be a shape type");
- if (shapeTy.getRank() != size)
- return emitOpError("shape type rank mismatch");
- return mlir::success();
- }];
+ let verifier = "return ::verify(*this);";
let extraClassDeclaration = [{
std::vector<mlir::Value> getExtents() {
}
//===----------------------------------------------------------------------===//
+// ShapeOp
+//===----------------------------------------------------------------------===//
+
+static mlir::LogicalResult verify(fir::ShapeOp &op) {
+ auto size = op.extents().size();
+ auto shapeTy = op.getType().dyn_cast<fir::ShapeType>();
+ assert(shapeTy && "must be a shape type");
+ if (shapeTy.getRank() != size)
+ return op.emitOpError("shape type rank mismatch");
+ return mlir::success();
+}
+
+//===----------------------------------------------------------------------===//
// ShapeShiftOp
//===----------------------------------------------------------------------===//