MLIR  19.0.0git
Public Member Functions | List of all members
mlir::irdl::BaseTypeConstraint Class Reference

A constraint that checks that a type is of a given type base (e.g. More...

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

+ Inheritance diagram for mlir::irdl::BaseTypeConstraint:

Public Member Functions

 BaseTypeConstraint (TypeID baseTypeID, StringRef baseName)
virtual ~BaseTypeConstraint ()=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 a type is of a given type base (e.g.


Definition at line 127 of file IRDLVerifiers.h.

Constructor & Destructor Documentation

◆ BaseTypeConstraint()

mlir::irdl::BaseTypeConstraint::BaseTypeConstraint ( TypeID  baseTypeID,
StringRef  baseName 

Definition at line 129 of file IRDLVerifiers.h.

◆ ~BaseTypeConstraint()

virtual mlir::irdl::BaseTypeConstraint::~BaseTypeConstraint ( )

Member Function Documentation

◆ verify()

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

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 84 of file IRDLVerifiers.cpp.

References mlir::emitError(), mlir::Type::getAbstractType(), mlir::AbstractType::getName(), and mlir::Type::getTypeID().

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