MLIR 22.0.0git
mlir::irdl::AnyOfConstraint Class Reference

A constraint checking that one of the given constraints is satisfied. More...

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

Inheritance diagram for mlir::irdl::AnyOfConstraint:

Public Member Functions

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

Detailed Description

A constraint checking that one of the given constraints is satisfied.

Definition at line 186 of file IRDLVerifiers.h.

Constructor & Destructor Documentation

◆ AnyOfConstraint()

mlir::irdl::AnyOfConstraint::AnyOfConstraint ( SmallVector< unsigned > constraints)
inline

Definition at line 188 of file IRDLVerifiers.h.

◆ ~AnyOfConstraint()

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

References mlir::emitError().

Member Function Documentation

◆ verify()

LogicalResult AnyOfConstraint::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 181 of file IRDLVerifiers.cpp.

References mlir::emitError(), success(), and mlir::irdl::ConstraintVerifier::verify().


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