MLIR 22.0.0git
mlir::tblgen::Constraint Class Reference

#include "mlir/TableGen/Constraint.h"

Inheritance diagram for mlir::tblgen::Constraint:

Public Types

enum  Kind {
  CK_Attr , CK_Prop , CK_Region , CK_Successor ,
  CK_Type , CK_Uncategorized
}

Public Member Functions

 Constraint (const llvm::Record *record, Kind kind)
 Constraint (const llvm::Record *record)
bool operator== (const Constraint &that)
 Constraints are pointer-comparable.
bool operator!= (const Constraint &that)
Pred getPredicate () const
std::string getConditionTemplate () const
StringRef getSummary () const
StringRef getDescription () const
StringRef getDefName () const
 Returns the name of the TablGen def of this constraint.
std::string getUniqueDefName () const
 Returns a unique name for the TablGen def of this constraint.
std::optional< StringRef > getCppFunctionName () const
 Returns the name of the C++ function that should be generated for this constraint, or std::nullopt if no C++ function should be generated.
Kind getKind () const
const llvm::Record & getDef () const
 Return the underlying def.

Protected Attributes

const llvm::Record * def

Detailed Description

Definition at line 30 of file Constraint.h.

Member Enumeration Documentation

◆ Kind

Enumerator
CK_Attr 
CK_Prop 
CK_Region 
CK_Successor 
CK_Type 
CK_Uncategorized 

Definition at line 33 of file Constraint.h.

Constructor & Destructor Documentation

◆ Constraint() [1/2]

mlir::tblgen::Constraint::Constraint ( const llvm::Record * record,
Kind kind )
inline

Definition at line 43 of file Constraint.h.

References def.

Referenced by Constraint(), operator!=(), and operator==().

◆ Constraint() [2/2]

Constraint::Constraint ( const llvm::Record * record)

Definition at line 19 of file Constraint.cpp.

References CK_Uncategorized, Constraint(), def, and if().

Member Function Documentation

◆ getConditionTemplate()

std::string Constraint::getConditionTemplate ( ) const

◆ getCppFunctionName()

std::optional< StringRef > Constraint::getCppFunctionName ( ) const

Returns the name of the C++ function that should be generated for this constraint, or std::nullopt if no C++ function should be generated.

Definition at line 114 of file Constraint.cpp.

References def.

◆ getDef()

const llvm::Record & mlir::tblgen::Constraint::getDef ( ) const
inline

Return the underlying def.

Definition at line 86 of file Constraint.h.

References def.

Referenced by mlir::tblgen::TypeConstraint::TypeConstraint().

◆ getDefName()

StringRef Constraint::getDefName ( ) const

Returns the name of the TablGen def of this constraint.

In some cases where the current def is anonymous, the name of the base def is used (e.g. std::optional<>/Variadic<> type constraints).

Definition at line 68 of file Constraint.cpp.

References def.

◆ getDescription()

StringRef Constraint::getDescription ( ) const

Definition at line 64 of file Constraint.cpp.

References def.

◆ getKind()

◆ getPredicate()

Pred Constraint::getPredicate ( ) const

Definition at line 41 of file Constraint.cpp.

References def.

Referenced by getConditionTemplate().

◆ getSummary()

StringRef Constraint::getSummary ( ) const

Definition at line 57 of file Constraint.cpp.

References def.

◆ getUniqueDefName()

std::string Constraint::getUniqueDefName ( ) const

Returns a unique name for the TablGen def of this constraint.

This is generally just the name of the def, but in some cases where the current def is anonymous, the name of the base def is attached (to provide more context on the def).

Definition at line 74 of file Constraint.cpp.

References def.

◆ operator!=()

bool mlir::tblgen::Constraint::operator!= ( const Constraint & that)
inline

Definition at line 49 of file Constraint.h.

References Constraint(), and def.

◆ operator==()

bool mlir::tblgen::Constraint::operator== ( const Constraint & that)
inline

Constraints are pointer-comparable.

Definition at line 48 of file Constraint.h.

References Constraint(), and def.

Member Data Documentation

◆ def

const llvm::Record* mlir::tblgen::Constraint::def
protected

Definition at line 90 of file Constraint.h.

Referenced by mlir::tblgen::ConstantProp::ConstantProp(), Constraint(), Constraint(), mlir::tblgen::Attribute::getAttrDefName(), mlir::tblgen::Attribute::getBaseAttr(), mlir::tblgen::Property::getBaseProperty(), mlir::tblgen::TypeConstraint::getBuilderCall(), mlir::tblgen::Attribute::getConstBuilderTemplate(), mlir::tblgen::Attribute::getConvertFromStorageCall(), getCppFunctionName(), mlir::tblgen::TypeConstraint::getCppType(), mlir::tblgen::Attribute::getDef(), getDef(), mlir::tblgen::Attribute::getDefaultValue(), getDefName(), mlir::tblgen::Attribute::getDerivedCodeBody(), getDescription(), mlir::tblgen::PropConstraint::getInterfaceType(), getPredicate(), mlir::tblgen::Property::getPredicate(), mlir::tblgen::Property::getPropertyDefName(), mlir::tblgen::Attribute::getReturnType(), mlir::tblgen::Attribute::getStorageType(), getSummary(), getUniqueDefName(), mlir::tblgen::ConstantProp::getValue(), mlir::tblgen::Attribute::getValueType(), mlir::tblgen::TypeConstraint::getVariadicOfVariadicSegmentSizeAttr(), mlir::tblgen::Attribute::hasDefaultValue(), mlir::tblgen::Attribute::isConstBuildable(), mlir::tblgen::TypeConstraint::isOptional(), mlir::tblgen::AttrConstraint::isSubClassOf(), mlir::tblgen::Property::isSubClassOf(), mlir::tblgen::Attribute::isSymbolRefAttr(), mlir::tblgen::Region::isVariadic(), mlir::tblgen::Successor::isVariadic(), mlir::tblgen::TypeConstraint::isVariadic(), mlir::tblgen::TypeConstraint::isVariadicOfVariadic(), operator!=(), operator==(), and mlir::tblgen::Property::Property().


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