MLIR
20.0.0git
|
Provides context to the verification of constraints. More...
#include "mlir/Dialect/IRDL/IRDLVerifiers.h"
Public Member Functions | |
ConstraintVerifier (ArrayRef< std::unique_ptr< Constraint >> constraints) | |
LogicalResult | verify (function_ref< InFlightDiagnostic()> emitError, Attribute attr, unsigned variable) |
Check that a constraint is satisfied by an attribute. More... | |
Provides context to the verification of constraints.
It contains the assignment of variables to attributes, and the assignment of variables to constraints.
Definition at line 40 of file IRDLVerifiers.h.
ConstraintVerifier::ConstraintVerifier | ( | ArrayRef< std::unique_ptr< Constraint >> | constraints | ) |
Definition at line 27 of file IRDLVerifiers.cpp.
LogicalResult ConstraintVerifier::verify | ( | function_ref< InFlightDiagnostic()> | emitError, |
Attribute | attr, | ||
unsigned | variable | ||
) |
Check that a constraint is satisfied by an attribute.
Constraints may call other constraint verifiers. If that is the case, the constraint verifier will check if the variable is already assigned, and if so, check that the attribute is the same as the one assigned. If the variable is not assigned, the constraint verifier will assign the attribute to the variable, and check that the constraint is satisfied.
Definition at line 34 of file IRDLVerifiers.cpp.
References mlir::emitError().
Referenced by irdlAttrOrTypeVerifier(), irdlOpVerifier(), mlir::irdl::DynParametricAttrConstraint::verify(), mlir::irdl::DynParametricTypeConstraint::verify(), mlir::irdl::AnyOfConstraint::verify(), mlir::irdl::AllOfConstraint::verify(), and mlir::irdl::RegionConstraint::verify().