| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* AttrDef Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* *| |
| 7 | \*===----------------------------------------------------------------------===*/ |
| 8 | |
| 9 | #ifdef GET_ATTRDEF_CLASSES |
| 10 | #undef GET_ATTRDEF_CLASSES |
| 11 | |
| 12 | #include "mlir/IR/Attributes.h" |
| 13 | |
| 14 | |
| 15 | namespace mlir { |
| 16 | class AsmParser; |
| 17 | class AsmPrinter; |
| 18 | } // namespace mlir |
| 19 | namespace mlir::irdl { |
| 20 | |
| 21 | /// A variadicity kind. Can be either 'single', 'optional', or 'variadic' |
| 22 | /// A `irdl.variadicity` attribute specifies that the associated operand or |
| 23 | /// result definition is either a single definition (the default), an |
| 24 | /// optional definition, or a variadic definition. |
| 25 | /// |
| 26 | /// For instance: |
| 27 | /// ```mlir |
| 28 | /// irdl.operands (%arg1, single %arg2, optional %arg3, variadic %arg4) |
| 29 | /// ``` |
| 30 | /// |
| 31 | /// In this example, both %arg1 and %arg2 are single operands, %arg3 is an |
| 32 | /// optional operand, and %arg4 is a variadic operand. |
| 33 | class VariadicityAttr; |
| 34 | class VariadicityArrayAttr; |
| 35 | namespace detail { |
| 36 | |
| 37 | struct VariadicityAttrStorage; |
| 38 | |
| 39 | } // namespace detail |
| 40 | class VariadicityAttr : public ::mlir::Attribute::AttrBase<VariadicityAttr, ::mlir::Attribute, detail::VariadicityAttrStorage> { |
| 41 | public: |
| 42 | using Base::Base; |
| 43 | static constexpr ::llvm::StringLiteral name = "irdl.variadicity" ; |
| 44 | static constexpr ::llvm::StringLiteral dialectName = "irdl" ; |
| 45 | static VariadicityAttr get(::mlir::MLIRContext *context, ::mlir::irdl::Variadicity value); |
| 46 | static constexpr ::llvm::StringLiteral getMnemonic() { |
| 47 | return {"variadicity" }; |
| 48 | } |
| 49 | |
| 50 | static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType); |
| 51 | void print(::mlir::AsmPrinter &odsPrinter) const; |
| 52 | ::mlir::irdl::Variadicity getValue() const; |
| 53 | }; |
| 54 | namespace detail { |
| 55 | |
| 56 | struct VariadicityArrayAttrStorage; |
| 57 | |
| 58 | } // namespace detail |
| 59 | class VariadicityArrayAttr : public ::mlir::Attribute::AttrBase<VariadicityArrayAttr, ::mlir::Attribute, detail::VariadicityArrayAttrStorage> { |
| 60 | public: |
| 61 | using Base::Base; |
| 62 | auto begin() const { return getValue().begin(); } |
| 63 | auto end() const { return getValue().end(); } |
| 64 | bool empty() const { return getValue().empty(); } |
| 65 | size_t size() const { return getValue().size(); } |
| 66 | auto &front() const { return getValue().front(); } |
| 67 | auto &back() const { return getValue().back(); } |
| 68 | auto &operator[](size_t index) { return getValue()[index]; } |
| 69 | operator ::llvm::ArrayRef<VariadicityAttr>() const { return getValue(); } |
| 70 | static constexpr ::llvm::StringLiteral name = "irdl.variadicity_array" ; |
| 71 | static constexpr ::llvm::StringLiteral dialectName = "irdl" ; |
| 72 | static VariadicityArrayAttr get(::mlir::MLIRContext *context, ::llvm::ArrayRef<VariadicityAttr> value); |
| 73 | static constexpr ::llvm::StringLiteral getMnemonic() { |
| 74 | return {"variadicity_array" }; |
| 75 | } |
| 76 | |
| 77 | static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType); |
| 78 | void print(::mlir::AsmPrinter &odsPrinter) const; |
| 79 | ::llvm::ArrayRef<VariadicityAttr> getValue() const; |
| 80 | }; |
| 81 | |
| 82 | } // namespace mlir::irdl |
| 83 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::irdl::VariadicityAttr) |
| 84 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::irdl::VariadicityArrayAttr) |
| 85 | |
| 86 | #endif // GET_ATTRDEF_CLASSES |
| 87 | |
| 88 | |