MLIR  19.0.0git
Public Member Functions | List of all members
mlir::LLVM::detail::LLVMStructTypeStorage::Key Class Reference

Construction/uniquing key class for LLVM dialect structure storage. More...

#include "Dialect/LLVMIR/IR/TypeDetail.h"

Public Member Functions

 Key (StringRef name, bool opaque, ArrayRef< Type > types=std::nullopt)
 Constructs a key for an identified struct. More...
 
 Key (ArrayRef< Type > types, bool packed)
 Constructs a key for a literal struct. More...
 
bool isIdentified () const
 Checks a specific property of the struct. More...
 
bool isPacked () const
 
bool isOpaque () const
 
StringRef getIdentifier () const
 Returns the identifier of a key for identified structs. More...
 
ArrayRef< TypegetTypeList () const
 Returns the list of type contained in the key of a literal struct. More...
 
ArrayRef< TypegetIdentifiedStructBody () const
 Returns the list of type contained in an identified struct. More...
 
llvm::hash_code hashValue () const
 Returns the hash value of the key. More...
 
bool operator== (const Key &other) const
 Compares two keys. More...
 
Key copyIntoAllocator (TypeStorageAllocator &allocator) const
 Copies dynamically-sized components of the key into the given allocator. More...
 

Detailed Description

Construction/uniquing key class for LLVM dialect structure storage.

Note that this is a transient helper data structure that is NOT stored. Therefore, it intentionally avoids bit manipulation and type erasure in pointers to make manipulation more straightforward. Not all elements of the key participate in uniquing, but all elements participate in construction.

Definition at line 69 of file TypeDetail.h.

Constructor & Destructor Documentation

◆ Key() [1/2]

mlir::LLVM::detail::LLVMStructTypeStorage::Key::Key ( StringRef  name,
bool  opaque,
ArrayRef< Type types = std::nullopt 
)
inline

Constructs a key for an identified struct.

Definition at line 72 of file TypeDetail.h.

Referenced by copyIntoAllocator().

◆ Key() [2/2]

mlir::LLVM::detail::LLVMStructTypeStorage::Key::Key ( ArrayRef< Type types,
bool  packed 
)
inline

Constructs a key for a literal struct.

Definition at line 76 of file TypeDetail.h.

Member Function Documentation

◆ copyIntoAllocator()

Key mlir::LLVM::detail::LLVMStructTypeStorage::Key::copyIntoAllocator ( TypeStorageAllocator allocator) const
inline

Copies dynamically-sized components of the key into the given allocator.

Definition at line 142 of file TypeDetail.h.

References mlir::StorageUniquer::StorageAllocator::copyInto(), isIdentified(), and Key().

Referenced by mlir::LLVM::detail::LLVMStructTypeStorage::construct().

◆ getIdentifiedStructBody()

ArrayRef<Type> mlir::LLVM::detail::LLVMStructTypeStorage::Key::getIdentifiedStructBody ( ) const
inline

Returns the list of type contained in an identified struct.

Definition at line 107 of file TypeDetail.h.

References isIdentified().

Referenced by mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::walk().

◆ getIdentifier()

StringRef mlir::LLVM::detail::LLVMStructTypeStorage::Key::getIdentifier ( ) const
inline

Returns the identifier of a key for identified structs.

Definition at line 93 of file TypeDetail.h.

References isIdentified().

Referenced by hashValue(), mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage(), and operator==().

◆ getTypeList()

ArrayRef<Type> mlir::LLVM::detail::LLVMStructTypeStorage::Key::getTypeList ( ) const
inline

◆ hashValue()

llvm::hash_code mlir::LLVM::detail::LLVMStructTypeStorage::Key::hashValue ( ) const
inline

Returns the hash value of the key.

This combines various flags into a single value: the identified flag sets the first bit, and the packedness flag sets the second bit. Opacity bit is only used for construction and does not participate in uniquing.

Definition at line 117 of file TypeDetail.h.

References getIdentifier(), getTypeList(), isIdentified(), and isPacked().

Referenced by mlir::LLVM::detail::LLVMStructTypeStorage::hashKey().

◆ isIdentified()

bool mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified ( ) const
inline

◆ isOpaque()

bool mlir::LLVM::detail::LLVMStructTypeStorage::Key::isOpaque ( ) const
inline

◆ isPacked()

bool mlir::LLVM::detail::LLVMStructTypeStorage::Key::isPacked ( ) const
inline

◆ operator==()

bool mlir::LLVM::detail::LLVMStructTypeStorage::Key::operator== ( const Key other) const
inline

Compares two keys.

Definition at line 132 of file TypeDetail.h.

References getIdentifier(), getTypeList(), isIdentified(), and isPacked().


The documentation for this class was generated from the following file: