38 if (
auto opTy = mlir::dyn_cast<OperationType>(*
this)) {
39 auto otherOpTy = mlir::dyn_cast<ast::OperationType>(other);
42 if (!otherOpTy.getName())
74 std::optional<StringRef> name,
78 std::make_pair(name.value_or(
""), odsOp));
83 return name.empty() ? std::optional<StringRef>()
84 : std::optional<StringRef>(name);
109 RangeType range = mlir::dyn_cast<RangeType>(type);
114 return mlir::cast<TypeRangeType>(
123 RangeType range = mlir::dyn_cast<RangeType>(type);
128 return mlir::cast<ValueRangeType>(
146 assert(elementTypes.size() == elementNames.size());
152 return get(context, elementTypes, elementNames);
#define MLIR_DEFINE_EXPLICIT_TYPE_ID(CLASS_NAME)
Storage * get(function_ref< void(Storage *)> initFn, TypeID id, Args &&...args)
Gets a uniqued instance of 'Storage'.
This class provides an efficient unique identifier for a specific C++ type.
This class represents a PDLL type that corresponds to an mlir::Attribute.
static AttributeType get(Context &context)
Return an instance of the Attribute type.
This class represents a PDLL type that corresponds to a constraint.
static ConstraintType get(Context &context)
Return an instance of the Constraint type.
This class represents the main context of the PDLL AST.
StorageUniquer & getTypeUniquer()
Return the storage uniquer used for AST types.
This class represents a PDLL type that corresponds to an mlir::Operation.
const ods::Operation * getODSOperation() const
Return the ODS operation that this type refers to, or nullptr if the ODS operation is unknown.
static OperationType get(Context &context, std::optional< StringRef > name=std::nullopt, const ods::Operation *odsOp=nullptr)
Return an instance of the Operation type with an optional operation name.
std::optional< StringRef > getName() const
Return the name of this operation type, or std::nullopt if it doesn't have on.
This class represents a PDLL type that corresponds to a range of elements with a given element type.
Type getElementType() const
Return the element type of this range.
static RangeType get(Context &context, Type elementType)
Return an instance of the Range type with the given element type.
This class represents a PDLL type that corresponds to a rewrite reference.
static RewriteType get(Context &context)
Return an instance of the Rewrite type.
This class represents a PDLL tuple type, i.e.
ArrayRef< StringRef > getElementNames() const
Return the element names of this tuple.
ArrayRef< Type > getElementTypes() const
Return the element types of this tuple.
static TupleType get(Context &context, ArrayRef< Type > elementTypes, ArrayRef< StringRef > elementNames)
Return an instance of the Tuple type.
This class represents a PDLL type that corresponds to an mlir::TypeRange.
static TypeRangeType get(Context &context)
Return an instance of the TypeRange type.
static bool classof(Type type)
Provide type casting support.
This class represents a PDLL type that corresponds to an mlir::Type.
static TypeType get(Context &context)
Return an instance of the Type type.
detail::AttributeTypeStorage ImplTy
TypeID getTypeID() const
Return the TypeID instance of this type.
Type(Storage *impl=nullptr)
const T * getImplAs() const
Return the internal storage instance of this type reinterpreted as the given derived storage type.
Type refineWith(Type other) const
Try to refine this type with the one provided.
This class represents a PDLL type that corresponds to an mlir::ValueRange.
static bool classof(Type type)
Provide type casting support.
static ValueRangeType get(Context &context)
Return an instance of the ValueRange type.
This class represents a PDLL type that corresponds to an mlir::Value.
static ValueType get(Context &context)
Return an instance of the Value type.
This class provides an ODS representation of a specific operation.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
llvm::function_ref< Fn > function_ref