| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* Interface Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* *| |
| 7 | \*===----------------------------------------------------------------------===*/ |
| 8 | |
| 9 | namespace mlir { |
| 10 | class TestExternalAttrInterface; |
| 11 | namespace detail { |
| 12 | struct TestExternalAttrInterfaceInterfaceTraits { |
| 13 | struct Concept { |
| 14 | /// The methods defined by the interface. |
| 15 | const ::mlir::Dialect *(*getDialectPtr)(const Concept *impl, ::mlir::Attribute ); |
| 16 | int (*)(); |
| 17 | }; |
| 18 | template<typename ConcreteAttr> |
| 19 | class Model : public Concept { |
| 20 | public: |
| 21 | using Interface = ::mlir::TestExternalAttrInterface; |
| 22 | Model() : Concept{.getDialectPtr: getDialectPtr, .getSomeNumber: getSomeNumber} {} |
| 23 | |
| 24 | static inline const ::mlir::Dialect *getDialectPtr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val); |
| 25 | static inline int getSomeNumber(); |
| 26 | }; |
| 27 | template<typename ConcreteAttr> |
| 28 | class FallbackModel : public Concept { |
| 29 | public: |
| 30 | using Interface = ::mlir::TestExternalAttrInterface; |
| 31 | FallbackModel() : Concept{.getDialectPtr: getDialectPtr, .getSomeNumber: getSomeNumber} {} |
| 32 | |
| 33 | static inline const ::mlir::Dialect *getDialectPtr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val); |
| 34 | static inline int getSomeNumber(); |
| 35 | }; |
| 36 | template<typename ConcreteModel, typename ConcreteAttr> |
| 37 | class ExternalModel : public FallbackModel<ConcreteModel> { |
| 38 | public: |
| 39 | using ConcreteEntity = ConcreteAttr; |
| 40 | }; |
| 41 | }; |
| 42 | template <typename ConcreteAttr> |
| 43 | struct TestExternalAttrInterfaceTrait; |
| 44 | |
| 45 | } // namespace detail |
| 46 | class TestExternalAttrInterface : public ::mlir::AttributeInterface<TestExternalAttrInterface, detail::TestExternalAttrInterfaceInterfaceTraits> { |
| 47 | public: |
| 48 | using ::mlir::AttributeInterface<TestExternalAttrInterface, detail::TestExternalAttrInterfaceInterfaceTraits>::AttributeInterface; |
| 49 | template <typename ConcreteAttr> |
| 50 | struct Trait : public detail::TestExternalAttrInterfaceTrait<ConcreteAttr> {}; |
| 51 | |
| 52 | /// Gets the dialect pointer. |
| 53 | const ::mlir::Dialect *getDialectPtr() const; |
| 54 | |
| 55 | /// Returns some number. |
| 56 | int () const; |
| 57 | }; |
| 58 | namespace detail { |
| 59 | template <typename ConcreteAttr> |
| 60 | struct TestExternalAttrInterfaceTrait : public ::mlir::AttributeInterface<TestExternalAttrInterface, detail::TestExternalAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> { |
| 61 | }; |
| 62 | }// namespace detail |
| 63 | } // namespace mlir |
| 64 | namespace mlir { |
| 65 | class TestOptionallyImplementedAttrInterface; |
| 66 | namespace detail { |
| 67 | struct TestOptionallyImplementedAttrInterfaceInterfaceTraits { |
| 68 | struct Concept { |
| 69 | /// The methods defined by the interface. |
| 70 | bool (*getImplementsInterface)(const Concept *impl, ::mlir::Attribute ); |
| 71 | }; |
| 72 | template<typename ConcreteAttr> |
| 73 | class Model : public Concept { |
| 74 | public: |
| 75 | using Interface = ::mlir::TestOptionallyImplementedAttrInterface; |
| 76 | Model() : Concept{.getImplementsInterface: getImplementsInterface} {} |
| 77 | |
| 78 | static inline bool getImplementsInterface(const Concept *impl, ::mlir::Attribute tablegen_opaque_val); |
| 79 | }; |
| 80 | template<typename ConcreteAttr> |
| 81 | class FallbackModel : public Concept { |
| 82 | public: |
| 83 | using Interface = ::mlir::TestOptionallyImplementedAttrInterface; |
| 84 | FallbackModel() : Concept{.getImplementsInterface: getImplementsInterface} {} |
| 85 | |
| 86 | static inline bool getImplementsInterface(const Concept *impl, ::mlir::Attribute tablegen_opaque_val); |
| 87 | }; |
| 88 | template<typename ConcreteModel, typename ConcreteAttr> |
| 89 | class ExternalModel : public FallbackModel<ConcreteModel> { |
| 90 | public: |
| 91 | using ConcreteEntity = ConcreteAttr; |
| 92 | }; |
| 93 | }; |
| 94 | template <typename ConcreteAttr> |
| 95 | struct TestOptionallyImplementedAttrInterfaceTrait; |
| 96 | |
| 97 | } // namespace detail |
| 98 | class TestOptionallyImplementedAttrInterface : public ::mlir::AttributeInterface<TestOptionallyImplementedAttrInterface, detail::TestOptionallyImplementedAttrInterfaceInterfaceTraits> { |
| 99 | public: |
| 100 | using ::mlir::AttributeInterface<TestOptionallyImplementedAttrInterface, detail::TestOptionallyImplementedAttrInterfaceInterfaceTraits>::AttributeInterface; |
| 101 | template <typename ConcreteAttr> |
| 102 | struct Trait : public detail::TestOptionallyImplementedAttrInterfaceTrait<ConcreteAttr> {}; |
| 103 | bool getImplementsInterface() const; |
| 104 | static bool classof(::mlir::Attribute base) { |
| 105 | auto* interface = getInterfaceFor(attr: base); |
| 106 | if (!interface) |
| 107 | return false; |
| 108 | TestOptionallyImplementedAttrInterface odsInterfaceInstance(base, interface); |
| 109 | return odsInterfaceInstance.getImplementsInterface(); |
| 110 | } |
| 111 | }; |
| 112 | namespace detail { |
| 113 | template <typename ConcreteAttr> |
| 114 | struct TestOptionallyImplementedAttrInterfaceTrait : public ::mlir::AttributeInterface<TestOptionallyImplementedAttrInterface, detail::TestOptionallyImplementedAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> { |
| 115 | }; |
| 116 | }// namespace detail |
| 117 | } // namespace mlir |
| 118 | namespace mlir { |
| 119 | template<typename ConcreteAttr> |
| 120 | const ::mlir::Dialect *detail::TestExternalAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getDialectPtr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) { |
| 121 | return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getDialectPtr(); |
| 122 | } |
| 123 | template<typename ConcreteAttr> |
| 124 | int detail::TestExternalAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::() { |
| 125 | return ConcreteAttr::getSomeNumber(); |
| 126 | } |
| 127 | template<typename ConcreteAttr> |
| 128 | const ::mlir::Dialect *detail::TestExternalAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getDialectPtr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) { |
| 129 | return static_cast<const ConcreteAttr *>(impl)->getDialectPtr(tablegen_opaque_val); |
| 130 | } |
| 131 | template<typename ConcreteAttr> |
| 132 | int detail::TestExternalAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::() { |
| 133 | return ConcreteAttr::getSomeNumber(); |
| 134 | } |
| 135 | } // namespace mlir |
| 136 | namespace mlir { |
| 137 | template<typename ConcreteAttr> |
| 138 | bool detail::TestOptionallyImplementedAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getImplementsInterface(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) { |
| 139 | return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getImplementsInterface(); |
| 140 | } |
| 141 | template<typename ConcreteAttr> |
| 142 | bool detail::TestOptionallyImplementedAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getImplementsInterface(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) { |
| 143 | return static_cast<const ConcreteAttr *>(impl)->getImplementsInterface(tablegen_opaque_val); |
| 144 | } |
| 145 | } // namespace mlir |
| 146 | |