MLIR  19.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::LLVM::detail::LLVMStructTypeStorage Struct Reference

Type storage for LLVM structure types. More...

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

+ Inheritance diagram for mlir::LLVM::detail::LLVMStructTypeStorage:

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< TypegetTypeList () const
 Returns the list of types (partially) identifying a literal struct. More...
 
ArrayRef< TypegetIdentifiedStructBody () 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 AbstractTypegetAbstractType ()
 Return the abstract type descriptor for this type. More...
 

Static Public Member Functions

static llvm::hash_code hashKey (const KeyTy &key)
 
static LLVMStructTypeStorageconstruct (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
 

Detailed Description

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.

Member Typedef Documentation

◆ KeyTy

Definition at line 154 of file TypeDetail.h.

Constructor & Destructor Documentation

◆ LLVMStructTypeStorage()

mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage ( const KeyTy key)
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().

Member Function Documentation

◆ construct()

static LLVMStructTypeStorage* mlir::LLVM::detail::LLVMStructTypeStorage::construct ( TypeStorageAllocator allocator,
const KeyTy key 
)
inlinestatic

◆ getAsKey()

Key mlir::LLVM::detail::LLVMStructTypeStorage::getAsKey ( ) const
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==().

◆ getIdentifiedStructBody()

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

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().

◆ getIdentifier()

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

Returns the string identifier of an identified struct.

Definition at line 157 of file TypeDetail.h.

References isIdentified().

Referenced by getAsKey().

◆ getTypeList()

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

Returns the list of types (partially) identifying a literal struct.

Definition at line 163 of file TypeDetail.h.

References isIdentified().

Referenced by getAsKey().

◆ hashKey()

static llvm::hash_code mlir::LLVM::detail::LLVMStructTypeStorage::hashKey ( const KeyTy key)
inlinestatic

◆ isIdentified()

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

Checks whether the struct is identified.

Definition at line 178 of file TypeDetail.h.

Referenced by getAsKey(), getIdentifiedStructBody(), getIdentifier(), getTypeList(), isPacked(), and mutate().

◆ isInitialized()

bool mlir::LLVM::detail::LLVMStructTypeStorage::isInitialized ( ) const
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().

◆ isOpaque()

bool mlir::LLVM::detail::LLVMStructTypeStorage::isOpaque ( ) const
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().

◆ isPacked()

bool mlir::LLVM::detail::LLVMStructTypeStorage::isPacked ( ) const
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().

◆ mutate()

LogicalResult mlir::LLVM::detail::LLVMStructTypeStorage::mutate ( TypeStorageAllocator allocator,
ArrayRef< Type body,
bool  packed 
)
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(), mlir::failure(), getIdentifiedStructBody(), isIdentified(), isInitialized(), isOpaque(), isPacked(), and mlir::success().

◆ operator==()

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

Hook into the type uniquing infrastructure.

Definition at line 230 of file TypeDetail.h.

References getAsKey().


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