Files
gps/tools/local/circt/include/mlir/Dialect/LLVMIR/LLVMAttrInterfaces.h.inc
T
2026-07-12 11:01:51 +03:00

598 lines
28 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Interface Declarations *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
namespace mlir::LLVM {
/// This attribute represents a DITypeAttr that is recursive. Only DITypeAttrs
/// that translate to LLVM DITypes that support mutation should implement this
/// interface.
///
/// There are two modes for conforming attributes:
///
/// 1. "rec-decl":
/// - This attr is a recursive declaration identified by a recId.
///
/// 2. "rec-self":
/// - This attr is considered a recursive self reference.
/// - This attr itself is a placeholder type that should be conceptually
/// replaced with the closest parent attr of the same type with the same
/// recId.
///
/// For example, to represent a linked list struct:
///
/// #rec_self = di_composite_type<recId = 0>
/// #ptr = di_derived_type<baseType: #rec_self, ...>
/// #field = di_derived_type<name = "next", baseType: #ptr, ...>
/// #rec = di_composite_type<recId = 0, name = "Node", elements: #field, ...>
/// #var = di_local_variable<type = #rec, ...>
///
/// Note that a rec-self without an outer rec-decl with the same recId is
/// conceptually the same as an "unbound" variable. The context needs to provide
/// meaning to the rec-self.
class DIRecursiveTypeAttrInterface;
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM address spaces.
/// Implementing attributes should provide access to the address space value
/// as an unsigned integer.
class LLVMAddrSpaceAttrInterface;
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM intrinsic integer immediate
/// arguments while using a richer dialect-specific assembly form.
///
/// The default implementation is intended for enum-style attributes whose
/// `getValue()` returns an enum with a storage type that matches the LLVM
/// immarg width. Attributes with non-enum storage or a different LLVM immarg
/// width must override `getIntegerAttr`.
class IntrinsicIntegerAttrInterface;
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM module flag metadata entries.
///
/// Implementing attributes provide the module flag merge behavior, metadata key,
/// and metadata value. This lets target dialects define richer, target-specific
/// module flag attributes while still sharing `llvm.module_flags` as the common
/// operation container. Values returned by this interface must use a shape that
/// can be exported to LLVM IR: integer attributes (exported as i32 constants),
/// string attributes, attributes implementing `IntrinsicIntegerAttrInterface`,
/// supported array values, or `ModuleFlagProfileSummaryAttr`.
class ModuleFlagAttrInterface;
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// Interface for attributes that describe LLVM targets.
///
/// These attributes should be able to return the specified target `triple`,
/// `chip` and `features`.
///
/// Implementing attributes should provide a `DLTIQueryInterface::query()`
/// implementation which responds to keys `"triple"`, `"chip"` and `"features"`
/// by returning appropriate `StringAttr`s.
class TargetAttrInterface;
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// This attribute represents a DITypeAttr that is recursive. Only DITypeAttrs
/// that translate to LLVM DITypes that support mutation should implement this
/// interface.
///
/// There are two modes for conforming attributes:
///
/// 1. "rec-decl":
/// - This attr is a recursive declaration identified by a recId.
///
/// 2. "rec-self":
/// - This attr is considered a recursive self reference.
/// - This attr itself is a placeholder type that should be conceptually
/// replaced with the closest parent attr of the same type with the same
/// recId.
///
/// For example, to represent a linked list struct:
///
/// #rec_self = di_composite_type<recId = 0>
/// #ptr = di_derived_type<baseType: #rec_self, ...>
/// #field = di_derived_type<name = "next", baseType: #ptr, ...>
/// #rec = di_composite_type<recId = 0, name = "Node", elements: #field, ...>
/// #var = di_local_variable<type = #rec, ...>
///
/// Note that a rec-self without an outer rec-decl with the same recId is
/// conceptually the same as an "unbound" variable. The context needs to provide
/// meaning to the rec-self.
namespace detail {
struct DIRecursiveTypeAttrInterfaceInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
bool (*getIsRecSelf)(const Concept *impl, ::mlir::Attribute );
DistinctAttr (*getRecId)(const Concept *impl, ::mlir::Attribute );
DIRecursiveTypeAttrInterface (*withRecId)(const Concept *impl, ::mlir::Attribute , DistinctAttr);
DIRecursiveTypeAttrInterface (*getRecSelf)(DistinctAttr);
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::LLVM::DIRecursiveTypeAttrInterface;
Model() : Concept{getIsRecSelf, getRecId, withRecId, getRecSelf} {}
static inline bool getIsRecSelf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DistinctAttr getRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DIRecursiveTypeAttrInterface withRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, DistinctAttr recId);
static inline DIRecursiveTypeAttrInterface getRecSelf(DistinctAttr recId);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::LLVM::DIRecursiveTypeAttrInterface;
FallbackModel() : Concept{getIsRecSelf, getRecId, withRecId, getRecSelf} {}
static inline bool getIsRecSelf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DistinctAttr getRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DIRecursiveTypeAttrInterface withRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, DistinctAttr recId);
static inline DIRecursiveTypeAttrInterface getRecSelf(DistinctAttr recId);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
};
};
template <typename ConcreteAttr>
struct DIRecursiveTypeAttrInterfaceTrait;
} // namespace detail
class DIRecursiveTypeAttrInterface : public ::mlir::AttributeInterface<DIRecursiveTypeAttrInterface, detail::DIRecursiveTypeAttrInterfaceInterfaceTraits> {
public:
using ::mlir::AttributeInterface<DIRecursiveTypeAttrInterface, detail::DIRecursiveTypeAttrInterfaceInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::DIRecursiveTypeAttrInterfaceTrait<ConcreteAttr> {};
/// Get whether this attr describes a recursive self reference.
bool getIsRecSelf() const;
/// Get the recursive ID used for matching "rec-decl" with "rec-self".
/// If this attr instance is not recursive, return a null attribute.
DistinctAttr getRecId() const;
/// Get a copy of this type attr but with the recursive ID set to `recId`.
DIRecursiveTypeAttrInterface withRecId(DistinctAttr recId) const;
/// Build a rec-self instance using the provided `recId`.
DIRecursiveTypeAttrInterface getRecSelf(DistinctAttr recId) const;
};
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM address spaces.
/// Implementing attributes should provide access to the address space value
/// as an unsigned integer.
namespace detail {
struct LLVMAddrSpaceAttrInterfaceInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
unsigned (*getAddressSpace)(const Concept *impl, ::mlir::Attribute );
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::LLVM::LLVMAddrSpaceAttrInterface;
Model() : Concept{getAddressSpace} {}
static inline unsigned getAddressSpace(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::LLVM::LLVMAddrSpaceAttrInterface;
FallbackModel() : Concept{getAddressSpace} {}
static inline unsigned getAddressSpace(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
};
};
template <typename ConcreteAttr>
struct LLVMAddrSpaceAttrInterfaceTrait;
} // namespace detail
class LLVMAddrSpaceAttrInterface : public ::mlir::AttributeInterface<LLVMAddrSpaceAttrInterface, detail::LLVMAddrSpaceAttrInterfaceInterfaceTraits> {
public:
using ::mlir::AttributeInterface<LLVMAddrSpaceAttrInterface, detail::LLVMAddrSpaceAttrInterfaceInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::LLVMAddrSpaceAttrInterfaceTrait<ConcreteAttr> {};
/// Returns the address space as an unsigned integer.
unsigned getAddressSpace() const;
};
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM intrinsic integer immediate
/// arguments while using a richer dialect-specific assembly form.
///
/// The default implementation is intended for enum-style attributes whose
/// `getValue()` returns an enum with a storage type that matches the LLVM
/// immarg width. Attributes with non-enum storage or a different LLVM immarg
/// width must override `getIntegerAttr`.
namespace detail {
struct IntrinsicIntegerAttrInterfaceInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
::mlir::IntegerAttr (*getIntegerAttr)(const Concept *impl, ::mlir::Attribute );
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::LLVM::IntrinsicIntegerAttrInterface;
Model() : Concept{getIntegerAttr} {}
static inline ::mlir::IntegerAttr getIntegerAttr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::LLVM::IntrinsicIntegerAttrInterface;
FallbackModel() : Concept{getIntegerAttr} {}
static inline ::mlir::IntegerAttr getIntegerAttr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
::mlir::IntegerAttr getIntegerAttr(::mlir::Attribute tablegen_opaque_val) const;
};
};
template <typename ConcreteAttr>
struct IntrinsicIntegerAttrInterfaceTrait;
} // namespace detail
class IntrinsicIntegerAttrInterface : public ::mlir::AttributeInterface<IntrinsicIntegerAttrInterface, detail::IntrinsicIntegerAttrInterfaceInterfaceTraits> {
public:
using ::mlir::AttributeInterface<IntrinsicIntegerAttrInterface, detail::IntrinsicIntegerAttrInterfaceInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::IntrinsicIntegerAttrInterfaceTrait<ConcreteAttr> {};
/// Returns the integer attribute to pass to LLVM.
::mlir::IntegerAttr getIntegerAttr() const;
};
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// An interface for attributes that represent LLVM module flag metadata entries.
///
/// Implementing attributes provide the module flag merge behavior, metadata key,
/// and metadata value. This lets target dialects define richer, target-specific
/// module flag attributes while still sharing `llvm.module_flags` as the common
/// operation container. Values returned by this interface must use a shape that
/// can be exported to LLVM IR: integer attributes (exported as i32 constants),
/// string attributes, attributes implementing `IntrinsicIntegerAttrInterface`,
/// supported array values, or `ModuleFlagProfileSummaryAttr`.
namespace detail {
struct ModuleFlagAttrInterfaceInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
::mlir::LLVM::ModFlagBehavior (*getModuleFlagBehavior)(const Concept *impl, ::mlir::Attribute );
::mlir::StringAttr (*getModuleFlagKey)(const Concept *impl, ::mlir::Attribute );
::mlir::Attribute (*getModuleFlagValue)(const Concept *impl, ::mlir::Attribute );
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::LLVM::ModuleFlagAttrInterface;
Model() : Concept{getModuleFlagBehavior, getModuleFlagKey, getModuleFlagValue} {}
static inline ::mlir::LLVM::ModFlagBehavior getModuleFlagBehavior(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline ::mlir::StringAttr getModuleFlagKey(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline ::mlir::Attribute getModuleFlagValue(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::LLVM::ModuleFlagAttrInterface;
FallbackModel() : Concept{getModuleFlagBehavior, getModuleFlagKey, getModuleFlagValue} {}
static inline ::mlir::LLVM::ModFlagBehavior getModuleFlagBehavior(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline ::mlir::StringAttr getModuleFlagKey(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline ::mlir::Attribute getModuleFlagValue(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
};
};
template <typename ConcreteAttr>
struct ModuleFlagAttrInterfaceTrait;
} // namespace detail
class ModuleFlagAttrInterface : public ::mlir::AttributeInterface<ModuleFlagAttrInterface, detail::ModuleFlagAttrInterfaceInterfaceTraits> {
public:
using ::mlir::AttributeInterface<ModuleFlagAttrInterface, detail::ModuleFlagAttrInterfaceInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::ModuleFlagAttrInterfaceTrait<ConcreteAttr> {};
/// Returns the module flag merge behavior.
::mlir::LLVM::ModFlagBehavior getModuleFlagBehavior() const;
/// Returns the module flag metadata key.
::mlir::StringAttr getModuleFlagKey() const;
/// Returns the module flag metadata value.
::mlir::Attribute getModuleFlagValue() const;
};
} // namespace mlir::LLVM
namespace mlir::LLVM {
/// Interface for attributes that describe LLVM targets.
///
/// These attributes should be able to return the specified target `triple`,
/// `chip` and `features`.
///
/// Implementing attributes should provide a `DLTIQueryInterface::query()`
/// implementation which responds to keys `"triple"`, `"chip"` and `"features"`
/// by returning appropriate `StringAttr`s.
namespace detail {
struct TargetAttrInterfaceInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
StringAttr (*getTriple)(const Concept *impl, ::mlir::Attribute );
StringAttr (*getChip)(const Concept *impl, ::mlir::Attribute );
Attribute (*getFeatures)(const Concept *impl, ::mlir::Attribute );
/// The base classes of this interface.
const ::mlir::DLTIQueryInterface::Concept *implDLTIQueryInterface = nullptr;
void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap) {
implDLTIQueryInterface = interfaceMap.lookup<::mlir::DLTIQueryInterface>();
assert(implDLTIQueryInterface && "`::mlir::LLVM::TargetAttrInterface` expected its base interface `::mlir::DLTIQueryInterface` to be registered");
}
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::LLVM::TargetAttrInterface;
Model() : Concept{getTriple, getChip, getFeatures} {}
static inline StringAttr getTriple(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline StringAttr getChip(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline Attribute getFeatures(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::LLVM::TargetAttrInterface;
FallbackModel() : Concept{getTriple, getChip, getFeatures} {}
static inline StringAttr getTriple(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline StringAttr getChip(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline Attribute getFeatures(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
};
};
template <typename ConcreteAttr>
struct TargetAttrInterfaceTrait;
} // namespace detail
class TargetAttrInterface : public ::mlir::AttributeInterface<TargetAttrInterface, detail::TargetAttrInterfaceInterfaceTraits> {
public:
using ::mlir::AttributeInterface<TargetAttrInterface, detail::TargetAttrInterfaceInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::TargetAttrInterfaceTrait<ConcreteAttr> {};
/// Returns the target triple identifier.
StringAttr getTriple() const;
/// Returns the target chip (i.e. "cpu") identifier.
StringAttr getChip() const;
/// Returns the target features as a TargetFeaturesAttr.
Attribute getFeatures() const;
//===----------------------------------------------------------------===//
// Inherited from ::mlir::DLTIQueryInterface
//===----------------------------------------------------------------===//
operator ::mlir::DLTIQueryInterface () const {
if (!*this) return nullptr;
return ::mlir::DLTIQueryInterface(*this, getImpl()->implDLTIQueryInterface);
}
/// Returns the attribute associated with the key.
::mlir::FailureOr<::mlir::Attribute> query(::mlir::DataLayoutEntryKey key) const;
};
} // namespace mlir::LLVM
namespace mlir::LLVM::detail {
template <typename ConcreteAttr>
struct DIRecursiveTypeAttrInterfaceTrait : public ::mlir::AttributeInterface<DIRecursiveTypeAttrInterface, detail::DIRecursiveTypeAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> {
};
} // namespace mlir::LLVM::detail
namespace mlir::LLVM::detail {
template <typename ConcreteAttr>
struct LLVMAddrSpaceAttrInterfaceTrait : public ::mlir::AttributeInterface<LLVMAddrSpaceAttrInterface, detail::LLVMAddrSpaceAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> {
};
} // namespace mlir::LLVM::detail
namespace mlir::LLVM::detail {
template <typename ConcreteAttr>
struct IntrinsicIntegerAttrInterfaceTrait : public ::mlir::AttributeInterface<IntrinsicIntegerAttrInterface, detail::IntrinsicIntegerAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> {
/// Returns the integer attribute to pass to LLVM.
::mlir::IntegerAttr getIntegerAttr() const {
using EnumType = decltype((*static_cast<const ConcreteAttr *>(this)).getValue());
using StorageType = std::underlying_type_t<EnumType>;
auto type = ::mlir::IntegerType::get((*static_cast<const ConcreteAttr *>(this)).getContext(),
sizeof(StorageType) * 8);
return ::mlir::IntegerAttr::get(
type, static_cast<StorageType>((*static_cast<const ConcreteAttr *>(this)).getValue()));
}
};
} // namespace mlir::LLVM::detail
namespace mlir::LLVM::detail {
template <typename ConcreteAttr>
struct ModuleFlagAttrInterfaceTrait : public ::mlir::AttributeInterface<ModuleFlagAttrInterface, detail::ModuleFlagAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> {
};
} // namespace mlir::LLVM::detail
namespace mlir::LLVM::detail {
template <typename ConcreteAttr>
struct TargetAttrInterfaceTrait : public ::mlir::AttributeInterface<TargetAttrInterface, detail::TargetAttrInterfaceInterfaceTraits>::Trait<ConcreteAttr> {
};
} // namespace mlir::LLVM::detail
namespace mlir::LLVM {
template<typename ConcreteAttr>
bool detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getIsRecSelf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getIsRecSelf();
}
template<typename ConcreteAttr>
DistinctAttr detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getRecId();
}
template<typename ConcreteAttr>
DIRecursiveTypeAttrInterface detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::withRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, DistinctAttr recId) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).withRecId(recId);
}
template<typename ConcreteAttr>
DIRecursiveTypeAttrInterface detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getRecSelf(DistinctAttr recId) {
return ConcreteAttr::getRecSelf(recId);
}
template<typename ConcreteAttr>
bool detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getIsRecSelf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getIsRecSelf(tablegen_opaque_val);
}
template<typename ConcreteAttr>
DistinctAttr detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getRecId(tablegen_opaque_val);
}
template<typename ConcreteAttr>
DIRecursiveTypeAttrInterface detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::withRecId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, DistinctAttr recId) {
return static_cast<const ConcreteAttr *>(impl)->withRecId(tablegen_opaque_val, recId);
}
template<typename ConcreteAttr>
DIRecursiveTypeAttrInterface detail::DIRecursiveTypeAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getRecSelf(DistinctAttr recId) {
return ConcreteAttr::getRecSelf(recId);
}
} // namespace mlir::LLVM
namespace mlir::LLVM {
template<typename ConcreteAttr>
unsigned detail::LLVMAddrSpaceAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getAddressSpace(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getAddressSpace();
}
template<typename ConcreteAttr>
unsigned detail::LLVMAddrSpaceAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getAddressSpace(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getAddressSpace(tablegen_opaque_val);
}
} // namespace mlir::LLVM
namespace mlir::LLVM {
template<typename ConcreteAttr>
::mlir::IntegerAttr detail::IntrinsicIntegerAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getIntegerAttr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getIntegerAttr();
}
template<typename ConcreteAttr>
::mlir::IntegerAttr detail::IntrinsicIntegerAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getIntegerAttr(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getIntegerAttr(tablegen_opaque_val);
}
template<typename ConcreteModel, typename ConcreteAttr>
::mlir::IntegerAttr detail::IntrinsicIntegerAttrInterfaceInterfaceTraits::ExternalModel<ConcreteModel, ConcreteAttr>::getIntegerAttr(::mlir::Attribute tablegen_opaque_val) const {
using EnumType = decltype((::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getValue());
using StorageType = std::underlying_type_t<EnumType>;
auto type = ::mlir::IntegerType::get((::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getContext(),
sizeof(StorageType) * 8);
return ::mlir::IntegerAttr::get(
type, static_cast<StorageType>((::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getValue()));
}
} // namespace mlir::LLVM
namespace mlir::LLVM {
template<typename ConcreteAttr>
::mlir::LLVM::ModFlagBehavior detail::ModuleFlagAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getModuleFlagBehavior(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getModuleFlagBehavior();
}
template<typename ConcreteAttr>
::mlir::StringAttr detail::ModuleFlagAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getModuleFlagKey(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getModuleFlagKey();
}
template<typename ConcreteAttr>
::mlir::Attribute detail::ModuleFlagAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getModuleFlagValue(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getModuleFlagValue();
}
template<typename ConcreteAttr>
::mlir::LLVM::ModFlagBehavior detail::ModuleFlagAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getModuleFlagBehavior(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getModuleFlagBehavior(tablegen_opaque_val);
}
template<typename ConcreteAttr>
::mlir::StringAttr detail::ModuleFlagAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getModuleFlagKey(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getModuleFlagKey(tablegen_opaque_val);
}
template<typename ConcreteAttr>
::mlir::Attribute detail::ModuleFlagAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getModuleFlagValue(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getModuleFlagValue(tablegen_opaque_val);
}
} // namespace mlir::LLVM
namespace mlir::LLVM {
template<typename ConcreteAttr>
StringAttr detail::TargetAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getTriple(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getTriple();
}
template<typename ConcreteAttr>
StringAttr detail::TargetAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getChip(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getChip();
}
template<typename ConcreteAttr>
Attribute detail::TargetAttrInterfaceInterfaceTraits::Model<ConcreteAttr>::getFeatures(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getFeatures();
}
template<typename ConcreteAttr>
StringAttr detail::TargetAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getTriple(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getTriple(tablegen_opaque_val);
}
template<typename ConcreteAttr>
StringAttr detail::TargetAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getChip(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getChip(tablegen_opaque_val);
}
template<typename ConcreteAttr>
Attribute detail::TargetAttrInterfaceInterfaceTraits::FallbackModel<ConcreteAttr>::getFeatures(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getFeatures(tablegen_opaque_val);
}
} // namespace mlir::LLVM