MLIR
21.0.0git
|
#include "mlir/TableGen/Constraint.h"
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. More... | |
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. More... | |
std::string | getUniqueDefName () const |
Returns a unique name for the TablGen def of this constraint. More... | |
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. More... | |
Kind | getKind () const |
const llvm::Record & | getDef () const |
Return the underlying def. More... | |
Protected Attributes | |
const llvm::Record * | def |
Definition at line 30 of file Constraint.h.
Enumerator | |
---|---|
CK_Attr | |
CK_Prop | |
CK_Region | |
CK_Successor | |
CK_Type | |
CK_Uncategorized |
Definition at line 33 of file Constraint.h.
|
inline |
Definition at line 43 of file Constraint.h.
References kind.
Constraint::Constraint | ( | const llvm::Record * | record | ) |
Definition at line 19 of file Constraint.cpp.
References CK_Attr, CK_Prop, CK_Region, CK_Successor, CK_Type, and def.
std::string Constraint::getConditionTemplate | ( | ) | const |
Definition at line 53 of file Constraint.cpp.
References mlir::tblgen::Pred::getCondition(), and getPredicate().
Referenced by canUniquePropConstraint(), and mlir::tblgen::DagLeaf::getConditionTemplate().
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.
|
inline |
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.
StringRef Constraint::getDescription | ( | ) | const |
Definition at line 64 of file Constraint.cpp.
References def.
|
inline |
Definition at line 83 of file Constraint.h.
Referenced by mlir::tblgen::AttrConstraint::classof(), mlir::tblgen::PropConstraint::classof(), mlir::tblgen::Region::classof(), mlir::tblgen::Successor::classof(), and mlir::tblgen::TypeConstraint::classof().
Pred Constraint::getPredicate | ( | ) | const |
Definition at line 41 of file Constraint.cpp.
References def.
Referenced by getConditionTemplate(), and mlir::tblgen::NamedTypeConstraint::hasPredicate().
StringRef Constraint::getSummary | ( | ) | const |
Definition at line 57 of file Constraint.cpp.
References def.
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.
|
inline |
Definition at line 49 of file Constraint.h.
References def.
|
inline |
|
protected |
Definition at line 90 of file Constraint.h.
Referenced by 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::Attribute::getValueType(), mlir::tblgen::TypeConstraint::getVariadicOfVariadicSegmentSizeAttr(), mlir::tblgen::Attribute::hasDefaultValue(), mlir::tblgen::Attribute::isConstBuildable(), mlir::tblgen::TypeConstraint::isOptional(), mlir::tblgen::AttrConstraint::isSubClassOf(), mlir::tblgen::Attribute::isSymbolRefAttr(), mlir::tblgen::Region::isVariadic(), mlir::tblgen::Successor::isVariadic(), mlir::tblgen::TypeConstraint::isVariadic(), mlir::tblgen::TypeConstraint::isVariadicOfVariadic(), operator!=(), and operator==().