23template <
typename TypeClass>
46mlir::InFlightDiagnostic
50 mlir::SymbolTableCollection &symbolTable,
StructDefOp &expectedStruct, mlir::Type actualType,
51 mlir::Operation *origin,
const char *aspect
67template <
char const *FuncName,
unsigned PrefixLen>
69 mlir::Operation *op, llvm::function_ref<llvm::SmallString<PrefixLen>()> prefix
73 : op->emitOpError(prefix())
75 <<
"' named \"@" << FuncName <<
"\" within a '"
82 template <
typename TypeClass>
class Impl :
public mlir::OpTrait::TraitBase<TypeClass, Impl> {
static mlir::LogicalResult verifyTrait(mlir::Operation *op)
Only valid/implemented for StructDefOp.
static mlir::LogicalResult verifyTrait(mlir::Operation *op)
InFlightDiagnostic genCompareErr(StructDefOp &expected, Operation *origin, const char *aspect)
bool isInStruct(Operation *op)
FailureOr< StructDefOp > verifyInStruct(Operation *op)
mlir::LogicalResult verifyInStructFunctionNamed(mlir::Operation *op, llvm::function_ref< llvm::SmallString< PrefixLen >()> prefix)
Checks if the given Operation is contained within a FuncDefOp with the given name that is itself cont...
bool isInStructFunctionNamed(Operation *op, char const *funcName)
LogicalResult checkSelfType(SymbolTableCollection &tables, StructDefOp &expectedStruct, Type actualType, Operation *origin, const char *aspect)
Verifies that the given actualType matches the StructDefOp given (i.e.
llvm::StringLiteral getOperationName()
Get the operation name, like "constrain.eq" for the given OpClass.
This class provides a verifier for ops that are expecting to have an ancestor FuncDefOp with the give...