MLIR
20.0.0git
|
This class represents a single parsed resource entry. More...
#include "mlir/IR/AsmState.h"
Public Types | |
using | BlobAllocatorFn = function_ref< AsmResourceBlob(size_t size, size_t align)> |
An allocator function used to allocate memory for a blob when required. More... | |
Public Member Functions | |
virtual | ~AsmParsedResourceEntry () |
virtual StringRef | getKey () const =0 |
Return the key of the resource entry. More... | |
virtual InFlightDiagnostic | emitError () const =0 |
Emit an error at the location of this entry. More... | |
virtual AsmResourceEntryKind | getKind () const =0 |
Return the kind of this value. More... | |
virtual FailureOr< bool > | parseAsBool () const =0 |
Parse the resource entry represented by a boolean. More... | |
virtual FailureOr< std::string > | parseAsString () const =0 |
Parse the resource entry represented by a human-readable string. More... | |
virtual FailureOr< AsmResourceBlob > | parseAsBlob (BlobAllocatorFn allocator) const =0 |
Parse the resource entry represented by a binary blob. More... | |
FailureOr< AsmResourceBlob > | parseAsBlob () const |
Parse the resource entry represented by a binary blob using heap allocation. More... | |
This class represents a single parsed resource entry.
Definition at line 290 of file AsmState.h.
using mlir::AsmParsedResourceEntry::BlobAllocatorFn = function_ref<AsmResourceBlob(size_t size, size_t align)> |
An allocator function used to allocate memory for a blob when required.
The function is provided a size and alignment, and should return an aligned allocation buffer.
Definition at line 314 of file AsmState.h.
|
virtualdefault |
|
pure virtual |
Emit an error at the location of this entry.
Referenced by mlir::OpAsmDialectInterface::parseResource().
|
pure virtual |
Return the key of the resource entry.
Referenced by mlir::OpAsmDialectInterface::parseResource().
|
pure virtual |
Return the kind of this value.
|
inline |
Parse the resource entry represented by a binary blob using heap allocation.
Definition at line 324 of file AsmState.h.
References mlir::HeapAsmResourceBlob::allocate().
|
pure virtual |
Parse the resource entry represented by a binary blob.
Returns failure if the entry does not correspond to a blob. If the blob needed to be allocated, the given allocator function is invoked.
|
pure virtual |
Parse the resource entry represented by a boolean.
Returns failure if the entry does not correspond to a bool.
|
pure virtual |
Parse the resource entry represented by a human-readable string.
Returns failure if the entry does not correspond to a string.