//===- Types.cpp ----------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "mlir/Tools/PDLL/AST/Types.h" #include "TypeDetail.h" #include "mlir/Tools/PDLL/AST/Context.h" #include <optional> usingnamespacemlir; usingnamespacemlir::pdll; usingnamespacemlir::pdll::ast; MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::AttributeTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::ConstraintTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::OperationTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::RangeTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::RewriteTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::TupleTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::TypeTypeStorage) MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::pdll::ast::detail::ValueTypeStorage) //===----------------------------------------------------------------------===// // Type //===----------------------------------------------------------------------===// TypeID Type::getTypeID() const { … } Type Type::refineWith(Type other) const { … } //===----------------------------------------------------------------------===// // AttributeType //===----------------------------------------------------------------------===// AttributeType AttributeType::get(Context &context) { … } //===----------------------------------------------------------------------===// // ConstraintType //===----------------------------------------------------------------------===// ConstraintType ConstraintType::get(Context &context) { … } //===----------------------------------------------------------------------===// // OperationType //===----------------------------------------------------------------------===// OperationType OperationType::get(Context &context, std::optional<StringRef> name, const ods::Operation *odsOp) { … } std::optional<StringRef> OperationType::getName() const { … } const ods::Operation *OperationType::getODSOperation() const { … } //===----------------------------------------------------------------------===// // RangeType //===----------------------------------------------------------------------===// RangeType RangeType::get(Context &context, Type elementType) { … } Type RangeType::getElementType() const { … } //===----------------------------------------------------------------------===// // TypeRangeType bool TypeRangeType::classof(Type type) { … } TypeRangeType TypeRangeType::get(Context &context) { … } //===----------------------------------------------------------------------===// // ValueRangeType bool ValueRangeType::classof(Type type) { … } ValueRangeType ValueRangeType::get(Context &context) { … } //===----------------------------------------------------------------------===// // RewriteType //===----------------------------------------------------------------------===// RewriteType RewriteType::get(Context &context) { … } //===----------------------------------------------------------------------===// // TupleType //===----------------------------------------------------------------------===// TupleType TupleType::get(Context &context, ArrayRef<Type> elementTypes, ArrayRef<StringRef> elementNames) { … } TupleType TupleType::get(Context &context, ArrayRef<Type> elementTypes) { … } ArrayRef<Type> TupleType::getElementTypes() const { … } ArrayRef<StringRef> TupleType::getElementNames() const { … } //===----------------------------------------------------------------------===// // TypeType //===----------------------------------------------------------------------===// TypeType TypeType::get(Context &context) { … } //===----------------------------------------------------------------------===// // ValueType //===----------------------------------------------------------------------===// ValueType ValueType::get(Context &context) { … }