MLIR  20.0.0git
Public Types | Public Member Functions | List of all members
mlir::AsmParsedResourceEntry Class Referenceabstract

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< AsmResourceBlobparseAsBlob (BlobAllocatorFn allocator) const =0
 Parse the resource entry represented by a binary blob. More...
 
FailureOr< AsmResourceBlobparseAsBlob () const
 Parse the resource entry represented by a binary blob using heap allocation. More...
 

Detailed Description

This class represents a single parsed resource entry.

Definition at line 290 of file AsmState.h.

Member Typedef Documentation

◆ BlobAllocatorFn

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.

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

References mlir::HeapAsmResourceBlob::allocate().

◆ 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: