9 #ifndef LIB_MLIR_TOOLS_PDLL_AST_TYPEDETAIL_H_
10 #define LIB_MLIR_TOOLS_PDLL_AST_TYPEDETAIL_H_
32 template <
typename ConcreteT,
typename KeyT =
void>
42 return new (alloc.
allocate<ConcreteT>()) ConcreteT(
key);
55 template <
typename ConcreteT>
79 std::pair<StringRef, const ods::Operation *>> {
84 const std::pair<StringRef, const ods::Operation *> &
key) {
110 std::pair<ArrayRef<Type>, ArrayRef<StringRef>>> {
117 key.second, [&](StringRef name) { return alloc.copyInto(name); }));
This class acts as the base storage that all storage classes must derived from.
This is a utility allocator used to allocate memory for instances of derived types.
ArrayRef< T > copyInto(ArrayRef< T > elements)
Copy the specified array of elements into memory managed by our bump pointer allocator.
T * allocate()
Allocate an instance of the provided type.
This class provides an efficient unique identifier for a specific C++ type.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
TypeID typeID
The type identifier for the derived type class.
static OperationTypeStorage * construct(StorageUniquer::StorageAllocator &alloc, const std::pair< StringRef, const ods::Operation * > &key)
static TupleTypeStorage * construct(StorageUniquer::StorageAllocator &alloc, std::pair< ArrayRef< Type >, ArrayRef< StringRef >> key)
A specialization of the storage base for singleton types.
A utility CRTP base class that defines many of the necessary utilities for defining a PDLL AST Type.
static ConcreteT * construct(StorageUniquer::StorageAllocator &alloc, const KeyTy &key)
Construct an instance with the given storage allocator.
TypeStorageBase(KeyTy key)
bool operator==(const KeyTy &key) const
Utility methods required by the storage allocator.
TypeStorageBase< OperationTypeStorage, std::pair< StringRef, const ods::Operation * > > Base
const KeyTy & getValue() const
Return the key value of this storage class.