MLIR  20.0.0git
Public Member Functions | List of all members
mlir::irdl::Constraint Class Referenceabstract

Once turned into IRDL verifiers, all constraints are attribute constraints. More...

#include "mlir/Dialect/IRDL/IRDLVerifiers.h"

+ Inheritance diagram for mlir::irdl::Constraint:

Public Member Functions

virtual ~Constraint ()=default
 
virtual LogicalResult verify (function_ref< InFlightDiagnostic()> emitError, Attribute attr, ConstraintVerifier &context) const =0
 Check that an attribute is satisfying the constraint. More...
 

Detailed Description

Once turned into IRDL verifiers, all constraints are attribute constraints.

Type constraints are represented as TypeAttr attribute constraints to simplify verification. Verification that a type constraint must yield a TypeAttr attribute happens before conversion, at the MLIR level.

Definition at line 71 of file IRDLVerifiers.h.

Constructor & Destructor Documentation

◆ ~Constraint()

virtual mlir::irdl::Constraint::~Constraint ( )
virtualdefault

Member Function Documentation

◆ verify()

virtual LogicalResult mlir::irdl::Constraint::verify ( function_ref< InFlightDiagnostic()>  emitError,
Attribute  attr,
ConstraintVerifier context 
) const
pure virtual

Check that an attribute is satisfying the constraint.

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.

Implemented in mlir::irdl::AnyAttributeConstraint, mlir::irdl::AllOfConstraint, mlir::irdl::AnyOfConstraint, mlir::irdl::DynParametricTypeConstraint, mlir::irdl::DynParametricAttrConstraint, mlir::irdl::BaseTypeConstraint, mlir::irdl::BaseAttrConstraint, and mlir::irdl::IsConstraint.


The documentation for this class was generated from the following file: