MLIR  20.0.0git
Public Member Functions | List of all members
mlir::irdl::ConstraintVerifier Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConstraintVerifier()

ConstraintVerifier::ConstraintVerifier ( ArrayRef< std::unique_ptr< Constraint >>  constraints)

Definition at line 27 of file IRDLVerifiers.cpp.

Member Function Documentation

◆ verify()

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().


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