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

A constraint that checks that an attribute is of a specific dynamic attribute definition, and that all of its parameters satisfy the given constraints. More...

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

+ Inheritance diagram for mlir::irdl::DynParametricAttrConstraint:

Public Member Functions

 DynParametricAttrConstraint (DynamicAttrDefinition *attrDef, SmallVector< unsigned > constraints)
 
virtual ~DynParametricAttrConstraint ()=default
 
LogicalResult verify (function_ref< InFlightDiagnostic()> emitError, Attribute attr, ConstraintVerifier &context) const override
 Check that an attribute is satisfying the constraint. More...
 
- Public Member Functions inherited from mlir::irdl::Constraint
virtual ~Constraint ()=default
 

Detailed Description

A constraint that checks that an attribute is of a specific dynamic attribute definition, and that all of its parameters satisfy the given constraints.

Definition at line 149 of file IRDLVerifiers.h.

Constructor & Destructor Documentation

◆ DynParametricAttrConstraint()

mlir::irdl::DynParametricAttrConstraint::DynParametricAttrConstraint ( DynamicAttrDefinition attrDef,
SmallVector< unsigned >  constraints 
)
inline

Definition at line 151 of file IRDLVerifiers.h.

◆ ~DynParametricAttrConstraint()

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

Member Function Documentation

◆ verify()

LogicalResult DynParametricAttrConstraint::verify ( function_ref< InFlightDiagnostic()>  emitError,
Attribute  attr,
ConstraintVerifier context 
) const
overridevirtual

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.

Implements mlir::irdl::Constraint.

Definition at line 103 of file IRDLVerifiers.cpp.

References mlir::emitError(), mlir::DynamicAttrDefinition::getDialect(), mlir::DynamicAttrDefinition::getName(), mlir::Dialect::getNamespace(), and mlir::irdl::ConstraintVerifier::verify().


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