@@ -151,19 +151,7 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
151
151
CArg<"mlir::ValueRange", "{}">:$shape,
152
152
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
153
153
154
- let verifier = [{
155
- llvm::SmallVector<llvm::StringRef> visited;
156
- if (verifyInType(getInType(), visited, numShapeOperands()))
157
- return emitOpError("invalid type for allocation");
158
- if (verifyTypeParamCount(getInType(), numLenParams()))
159
- return emitOpError("LEN params do not correspond to type");
160
- mlir::Type outType = getType();
161
- if (!outType.isa<fir::ReferenceType>())
162
- return emitOpError("must be a !fir.ref type");
163
- if (fir::isa_unknown_size_box(fir::dyn_cast_ptrEleTy(outType)))
164
- return emitOpError("cannot allocate !fir.box of unknown rank or type");
165
- return mlir::success();
166
- }];
154
+ let verifier = [{ return ::verify(*this); }];
167
155
168
156
let extraClassDeclaration = [{
169
157
mlir::Type getAllocatedType();
@@ -220,19 +208,7 @@ def fir_AllocMemOp : fir_Op<"allocmem",
220
208
CArg<"mlir::ValueRange", "{}">:$shape,
221
209
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
222
210
223
- let verifier = [{
224
- llvm::SmallVector<llvm::StringRef> visited;
225
- if (verifyInType(getInType(), visited, numShapeOperands()))
226
- return emitOpError("invalid type for allocation");
227
- if (verifyTypeParamCount(getInType(), numLenParams()))
228
- return emitOpError("LEN params do not correspond to type");
229
- mlir::Type outType = getType();
230
- if (!outType.dyn_cast<fir::HeapType>())
231
- return emitOpError("must be a !fir.heap type");
232
- if (fir::isa_unknown_size_box(fir::dyn_cast_ptrEleTy(outType)))
233
- return emitOpError("cannot allocate !fir.box of unknown rank or type");
234
- return mlir::success();
235
- }];
211
+ let verifier = [{ return ::verify(*this); }];
236
212
237
213
let extraClassDeclaration = [{
238
214
mlir::Type getAllocatedType();
0 commit comments