MLIR  15.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:
+ Collaboration 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...
 
- 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 147 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 200 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

◆ getIdentifiedStructBody()

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

Returns the list of types contained in an identified struct.

Definition at line 163 of file TypeDetail.h.

References mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified().

Referenced by mutate().

◆ getIdentifier()

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

Returns the string identifier of an identified struct.

Definition at line 150 of file TypeDetail.h.

References mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified().

◆ getTypeList()

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

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

Definition at line 156 of file TypeDetail.h.

References mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified().

◆ 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 171 of file TypeDetail.h.

◆ 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 191 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 185 of file TypeDetail.h.

◆ isPacked()

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

Checks whether the struct is packed (both literal and identified structs).

Definition at line 176 of file TypeDetail.h.

References mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified().

◆ 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 235 of file TypeDetail.h.

References mlir::StorageUniquer::StorageAllocator::copyInto(), mlir::failure(), getIdentifiedStructBody(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::getIdentifier(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::getTypeList(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::isIdentified(), isInitialized(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::isOpaque(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::isPacked(), mlir::LLVM::detail::LLVMStructTypeStorage::Key::Key(), mlir::success(), and value.

◆ operator==()

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

Hook into the type uniquing infrastructure.

Definition at line 223 of file TypeDetail.h.


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