MLIR  19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::AsmResourceParser Class Referenceabstract

This class represents an instance of a resource parser. More...

#include "mlir/IR/AsmState.h"

Public Member Functions

 AsmResourceParser (StringRef name)
 Create a new parser with the given identifying name. More...
 
virtual ~AsmResourceParser ()
 
StringRef getName () const
 Return the name of this parser. More...
 
virtual LogicalResult parseResource (AsmParsedResourceEntry &entry)=0
 Parse the given resource entry. More...
 

Static Public Member Functions

template<typename CallableT >
static std::unique_ptr< AsmResourceParserfromCallable (StringRef name, CallableT &&parseFn)
 Return a resource parser implemented via the given callable, whose form should match that of parseResource above. More...
 

Detailed Description

This class represents an instance of a resource parser.

This class should be implemented by non-dialect clients that want to inject additional resources into MLIR assembly formats.

Definition at line 330 of file AsmState.h.

Constructor & Destructor Documentation

◆ AsmResourceParser()

mlir::AsmResourceParser::AsmResourceParser ( StringRef  name)
inline

Create a new parser with the given identifying name.

This name uniquely identifies the entries of this parser, and differentiates them from other contexts.

Definition at line 335 of file AsmState.h.

Referenced by fromCallable().

◆ ~AsmResourceParser()

AsmResourceParser::~AsmResourceParser ( )
virtualdefault

Member Function Documentation

◆ fromCallable()

template<typename CallableT >
static std::unique_ptr<AsmResourceParser> mlir::AsmResourceParser::fromCallable ( StringRef  name,
CallableT &&  parseFn 
)
inlinestatic

Return a resource parser implemented via the given callable, whose form should match that of parseResource above.

Definition at line 349 of file AsmState.h.

References AsmResourceParser(), and parseResource().

Referenced by mlir::ParserConfig::attachResourceParser().

◆ getName()

StringRef mlir::AsmResourceParser::getName ( ) const
inline

Return the name of this parser.

Definition at line 339 of file AsmState.h.

◆ parseResource()

virtual LogicalResult mlir::AsmResourceParser::parseResource ( AsmParsedResourceEntry entry)
pure virtual

Parse the given resource entry.

Returns failure if the key/data were not valid, or could otherwise not be processed correctly. Any necessary errors should be emitted with the provided entry.

Referenced by fromCallable().


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