MLIR 22.0.0git
mlir::AsmParsedResourceEntry Class Referenceabstract

This class represents a single parsed resource entry. More...

#include "mlir/IR/AsmState.h"

Public Types

using BlobAllocatorFn
 An allocator function used to allocate memory for a blob when required.

Public Member Functions

virtual ~AsmParsedResourceEntry ()
virtual StringRef getKey () const =0
 Return the key of the resource entry.
virtual InFlightDiagnostic emitError () const =0
 Emit an error at the location of this entry.
virtual AsmResourceEntryKind getKind () const =0
 Return the kind of this value.
virtual FailureOr< boolparseAsBool () const =0
 Parse the resource entry represented by a boolean.
virtual FailureOr< std::string > parseAsString () const =0
 Parse the resource entry represented by a human-readable string.
virtual FailureOr< AsmResourceBlobparseAsBlob (BlobAllocatorFn allocator) const =0
 Parse the resource entry represented by a binary blob.
FailureOr< AsmResourceBlobparseAsBlob () const
 Parse the resource entry represented by a binary blob using heap allocation.

Detailed Description

This class represents a single parsed resource entry.

Definition at line 291 of file AsmState.h.

Member Typedef Documentation

◆ BlobAllocatorFn

Initial value:
function_ref<AsmResourceBlob(size_t size, size_t align)>
This class represents a processed binary blob of data.
Definition AsmState.h:91
llvm::function_ref< Fn > function_ref
Definition LLVM.h:152

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 315 of file AsmState.h.

Constructor & Destructor Documentation

◆ ~AsmParsedResourceEntry()

AsmParsedResourceEntry::~AsmParsedResourceEntry ( )
virtualdefault

Member Function Documentation

◆ emitError()

virtual InFlightDiagnostic mlir::AsmParsedResourceEntry::emitError ( ) const
pure virtual

Emit an error at the location of this entry.

Referenced by mlir::OpAsmDialectInterface::parseResource().

◆ getKey()

virtual StringRef mlir::AsmParsedResourceEntry::getKey ( ) const
pure virtual

Return the key of the resource entry.

Referenced by mlir::OpAsmDialectInterface::parseResource().

◆ getKind()

virtual AsmResourceEntryKind mlir::AsmParsedResourceEntry::getKind ( ) const
pure virtual

Return the kind of this value.

◆ parseAsBlob() [1/2]

FailureOr< AsmResourceBlob > mlir::AsmParsedResourceEntry::parseAsBlob ( ) const
inline

Parse the resource entry represented by a binary blob using heap allocation.

Definition at line 325 of file AsmState.h.

References mlir::HeapAsmResourceBlob::allocate(), and parseAsBlob().

Referenced by parseAsBlob().

◆ parseAsBlob() [2/2]

virtual FailureOr< AsmResourceBlob > mlir::AsmParsedResourceEntry::parseAsBlob ( BlobAllocatorFn allocator) const
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.

◆ parseAsBool()

virtual FailureOr< bool > mlir::AsmParsedResourceEntry::parseAsBool ( ) const
pure virtual

Parse the resource entry represented by a boolean.

Returns failure if the entry does not correspond to a bool.

◆ parseAsString()

virtual FailureOr< std::string > mlir::AsmParsedResourceEntry::parseAsString ( ) const
pure virtual

Parse the resource entry represented by a human-readable string.

Returns failure if the entry does not correspond to a string.


The documentation for this class was generated from the following files: