[PATCH] D110826: [fir][NFC] Move fir.shape verifier to cpp file
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 30 07:26:54 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGafb30fcdf672: [fir][NFC] Move fir.shape verifier to cpp file (authored by clementval).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110826/new/
https://reviews.llvm.org/D110826
Files:
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Optimizer/Dialect/FIROps.cpp
Index: flang/lib/Optimizer/Dialect/FIROps.cpp
===================================================================
--- flang/lib/Optimizer/Dialect/FIROps.cpp
+++ flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -2606,6 +2606,19 @@
return mlir::success();
}
+//===----------------------------------------------------------------------===//
+// 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
//===----------------------------------------------------------------------===//
Index: flang/include/flang/Optimizer/Dialect/FIROps.td
===================================================================
--- flang/include/flang/Optimizer/Dialect/FIROps.td
+++ flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -1841,14 +1841,7 @@
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() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110826.376213.patch
Type: text/x-patch
Size: 1669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210930/067ee4bc/attachment.bin>
More information about the llvm-commits
mailing list