MLIR
21.0.0git
|
This class represents a processed binary blob of data. More...
#include "mlir/IR/AsmState.h"
Public Types | |
using | DeleterFn = llvm::unique_function< void(void *data, size_t size, size_t align)> |
A deleter function that frees a blob given the data, allocation size, and allocation aligment. More... | |
Public Member Functions | |
AsmResourceBlob ()=default | |
AsmResourceBlob (ArrayRef< char > data, size_t dataAlignment, DeleterFn deleter, bool dataIsMutable) | |
template<typename T , typename DelT > | |
AsmResourceBlob (ArrayRef< T > data, DelT &&deleteFn, bool dataIsMutable) | |
Utility constructor that initializes a blob with a non-char type T. More... | |
AsmResourceBlob (AsmResourceBlob &&)=default | |
AsmResourceBlob & | operator= (AsmResourceBlob &&rhs) |
AsmResourceBlob (const AsmResourceBlob &)=delete | |
AsmResourceBlob & | operator= (const AsmResourceBlob &)=delete |
~AsmResourceBlob () | |
size_t | getDataAlignment () const |
Return the alignment of the underlying data. More... | |
ArrayRef< char > | getData () const |
Return the raw underlying data of this blob. More... | |
template<typename T > | |
ArrayRef< T > | getDataAs () const |
Return the underlying data as an array of the given type. More... | |
MutableArrayRef< char > | getMutableData () |
Return a mutable reference to the raw underlying data of this blob. More... | |
bool | isMutable () const |
Return if the data of this blob is mutable. More... | |
DeleterFn & | getDeleter () |
Return the deleter function of this blob. More... | |
const DeleterFn & | getDeleter () const |
Friends | |
class | HeapAsmResourceBlob |
This class represents a processed binary blob of data.
A resource blob is essentially a collection of data, potentially mutable, with an associated deleter function (used if the data needs to be destroyed).
Definition at line 91 of file AsmState.h.
using mlir::AsmResourceBlob::DeleterFn = llvm::unique_function<void(void *data, size_t size, size_t align)> |
A deleter function that frees a blob given the data, allocation size, and allocation aligment.
Definition at line 95 of file AsmState.h.
|
default |
|
inline |
Definition at line 103 of file AsmState.h.
|
inline |
Utility constructor that initializes a blob with a non-char type T.
Definition at line 109 of file AsmState.h.
|
default |
|
delete |
|
inline |
Definition at line 132 of file AsmState.h.
|
inline |
Return the raw underlying data of this blob.
Definition at line 145 of file AsmState.h.
Referenced by mlir::AsmResourceBuilder::buildBlob(), convertDenseResourceElementsAttr(), and mlir::detail::DenseResourceElementsAttrBase< T >::get().
|
inline |
Return the alignment of the underlying data.
Definition at line 142 of file AsmState.h.
Referenced by mlir::AsmResourceBuilder::buildBlob(), and mlir::detail::DenseResourceElementsAttrBase< T >::get().
|
inline |
Return the underlying data as an array of the given type.
This is an inherrently unsafe operation, and should only be used when the data is known to be of the correct type.
Definition at line 151 of file AsmState.h.
|
inline |
Return the deleter function of this blob.
Definition at line 167 of file AsmState.h.
|
inline |
Definition at line 168 of file AsmState.h.
|
inline |
Return a mutable reference to the raw underlying data of this blob.
Asserts that the blob isMutable
.
Definition at line 157 of file AsmState.h.
References isMutable().
Referenced by mlir::HeapAsmResourceBlob::allocateAndCopyWithAlign().
|
inline |
Return if the data of this blob is mutable.
Definition at line 164 of file AsmState.h.
Referenced by getMutableData().
|
inline |
Definition at line 118 of file AsmState.h.
|
delete |
|
friend |
Definition at line 184 of file AsmState.h.