MLIR
20.0.0git
|
Type storage for LLVM structure types. More...
#include "Dialect/LLVMIR/IR/TypeDetail.h"
Classes | |
class | Key |
Construction/uniquing key class for LLVM dialect structure storage. More... | |
Public Types | |
using | KeyTy = Key |
Public Member Functions | |
StringRef | getIdentifier () const |
Returns the string identifier of an identified struct. More... | |
ArrayRef< Type > | getTypeList () const |
Returns the list of types (partially) identifying a literal struct. More... | |
ArrayRef< Type > | getIdentifiedStructBody () const |
Returns the list of types contained in an identified struct. More... | |
bool | isIdentified () const |
Checks whether the struct is identified. More... | |
bool | isPacked () const |
Checks whether the struct is packed (both literal and identified structs). More... | |
bool | isOpaque () const |
Checks whether a struct is marked as intentionally opaque (an uninitialized struct is also considered opaque by the user, call isInitialized to check that). More... | |
bool | isInitialized () const |
Checks whether an identified struct has been explicitly initialized either by setting its body or by marking it as intentionally opaque. More... | |
LLVMStructTypeStorage (const KeyTy &key) | |
Constructs the storage from the given key. More... | |
bool | operator== (const KeyTy &other) const |
Hook into the type uniquing infrastructure. More... | |
LogicalResult | mutate (TypeStorageAllocator &allocator, ArrayRef< Type > body, bool packed) |
Sets the body of an identified struct. More... | |
Key | getAsKey () const |
Returns the key for the current storage. More... | |
Public Member Functions inherited from mlir::TypeStorage | |
const AbstractType & | getAbstractType () |
Return the abstract type descriptor for this type. More... | |
Static Public Member Functions | |
static llvm::hash_code | hashKey (const KeyTy &key) |
static LLVMStructTypeStorage * | construct (TypeStorageAllocator &allocator, const KeyTy &key) |
Additional Inherited Members | |
Protected Member Functions inherited from mlir::TypeStorage | |
TypeStorage () | |
This constructor is used by derived classes as part of the TypeUniquer. More... | |
Protected Member Functions inherited from mlir::StorageUniquer::BaseStorage | |
BaseStorage ()=default | |
Type storage for LLVM structure types.
Structures are uniqued using:
Identified structures only have a mutable component consisting of:
The struct storage consists of:
Definition at line 61 of file TypeDetail.h.
Definition at line 154 of file TypeDetail.h.
|
inline |
Constructs the storage from the given key.
This sets up the uniquing key components and optionally the mutable component if they construction key has the relevant information. In the latter case, the struct is considered as initialized and can no longer be mutated.
Definition at line 207 of file TypeDetail.h.
References mlir::LLVM::detail::LLVMStructTypeStorage::Key::getIdentifier(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::getTypeList(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::isOpaque(), and mlir::LLVM::detail::LLVMStructTypeStorage::Key::isPacked().
Referenced by construct().
|
inlinestatic |
Definition at line 232 of file TypeDetail.h.
References mlir::StorageUniquer::StorageAllocator::allocate(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::copyIntoAllocator(), and LLVMStructTypeStorage().
|
inline |
Returns the key for the current storage.
Definition at line 262 of file TypeDetail.h.
References getIdentifiedStructBody(), getIdentifier(), getTypeList(), isIdentified(), isOpaque(), and isPacked().
Referenced by operator==().
Returns the list of types contained in an identified struct.
Definition at line 170 of file TypeDetail.h.
References isIdentified().
Referenced by getAsKey(), and mutate().
|
inline |
Returns the string identifier of an identified struct.
Definition at line 157 of file TypeDetail.h.
References isIdentified().
Referenced by getAsKey().
Returns the list of types (partially) identifying a literal struct.
Definition at line 163 of file TypeDetail.h.
References isIdentified().
Referenced by getAsKey().
|
inlinestatic |
Definition at line 231 of file TypeDetail.h.
References mlir::LLVM::detail::LLVMStructTypeStorage::Key::hashValue().
|
inline |
Checks whether the struct is identified.
Definition at line 178 of file TypeDetail.h.
Referenced by getAsKey(), getIdentifiedStructBody(), getIdentifier(), getTypeList(), isPacked(), and mutate().
|
inline |
Checks whether an identified struct has been explicitly initialized either by setting its body or by marking it as intentionally opaque.
Definition at line 198 of file TypeDetail.h.
Referenced by mutate().
|
inline |
Checks whether a struct is marked as intentionally opaque (an uninitialized struct is also considered opaque by the user, call isInitialized to check that).
Definition at line 192 of file TypeDetail.h.
Referenced by getAsKey(), and mutate().
|
inline |
Checks whether the struct is packed (both literal and identified structs).
Definition at line 183 of file TypeDetail.h.
References isIdentified().
Referenced by getAsKey(), and mutate().
|
inline |
Sets the body of an identified struct.
If the struct is already initialized, succeeds only if the body is equal to the current body. Fails if the struct is marked as intentionally opaque. The struct will be marked as initialized as a result of this operation and can no longer be changed.
Definition at line 242 of file TypeDetail.h.
References mlir::StorageUniquer::StorageAllocator::copyInto(), getIdentifiedStructBody(), isIdentified(), isInitialized(), isOpaque(), and isPacked().
|
inline |
Hook into the type uniquing infrastructure.
Definition at line 230 of file TypeDetail.h.
References getAsKey().