/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir { /// Interface to query derived attribute characteristics. /// /// Derived attributes are not stored in the operation but are instead derived /// from information of the operation. ODS generates convenience accessors for /// derived attributes and can be used to simplify translations. class DerivedAttributeOpInterface; } // namespace mlir namespace mlir { /// Interface to query derived attribute characteristics. /// /// Derived attributes are not stored in the operation but are instead derived /// from information of the operation. ODS generates convenience accessors for /// derived attributes and can be used to simplify translations. namespace detail { struct DerivedAttributeOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. bool (*isDerivedAttribute)(::mlir::StringRef); ::mlir::DictionaryAttr (*materializeDerivedAttributes)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::DerivedAttributeOpInterface; Model() : Concept{isDerivedAttribute, materializeDerivedAttributes} {} static inline bool isDerivedAttribute(::mlir::StringRef name); static inline ::mlir::DictionaryAttr materializeDerivedAttributes(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::DerivedAttributeOpInterface; FallbackModel() : Concept{isDerivedAttribute, materializeDerivedAttributes} {} static inline bool isDerivedAttribute(::mlir::StringRef name); static inline ::mlir::DictionaryAttr materializeDerivedAttributes(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct DerivedAttributeOpInterfaceTrait; } // namespace detail class DerivedAttributeOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::DerivedAttributeOpInterfaceTrait {}; /// Returns whether name corresponds to a derived attribute. bool isDerivedAttribute(::mlir::StringRef name); /// Materializes the derived attributes. Returns null attribute where /// unable to materialize a derived attribute as attribute. ::mlir::DictionaryAttr materializeDerivedAttributes(); }; } // namespace mlir namespace mlir::detail { template struct DerivedAttributeOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::detail namespace mlir { template bool detail::DerivedAttributeOpInterfaceInterfaceTraits::Model::isDerivedAttribute(::mlir::StringRef name) { return ConcreteOp::isDerivedAttribute(name); } template ::mlir::DictionaryAttr detail::DerivedAttributeOpInterfaceInterfaceTraits::Model::materializeDerivedAttributes(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).materializeDerivedAttributes(); } template bool detail::DerivedAttributeOpInterfaceInterfaceTraits::FallbackModel::isDerivedAttribute(::mlir::StringRef name) { return ConcreteOp::isDerivedAttribute(name); } template ::mlir::DictionaryAttr detail::DerivedAttributeOpInterfaceInterfaceTraits::FallbackModel::materializeDerivedAttributes(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->materializeDerivedAttributes(tablegen_opaque_val); } } // namespace mlir