MLIR  16.0.0git
Public Member Functions | List of all members
mlir::ParserConfig Class Reference

This class represents a configuration for the MLIR assembly parser. More...

#include "mlir/IR/AsmState.h"

Public Member Functions

 ParserConfig (MLIRContext *context)
 
MLIRContextgetContext () const
 Return the MLIRContext to be used when parsing. More...
 
AsmResourceParsergetResourceParser (StringRef name) const
 Return the resource parser registered to the given name, or nullptr if no parser with name is registered. More...
 
void attachResourceParser (std::unique_ptr< AsmResourceParser > parser)
 Attach the given resource parser. More...
 
template<typename CallableT >
std::enable_if_t< std::is_convertible< CallableT, function_ref< LogicalResult(AsmParsedResourceEntry &)> >::valueattachResourceParser (StringRef name, CallableT &&parserFn)
 Attach the given callable resource parser with the given name. More...
 

Detailed Description

This class represents a configuration for the MLIR assembly parser.

It contains all of the necessary state to parse a MLIR source file.

Definition at line 395 of file AsmState.h.

Constructor & Destructor Documentation

◆ ParserConfig()

mlir::ParserConfig::ParserConfig ( MLIRContext context)
inline

Definition at line 397 of file AsmState.h.

Member Function Documentation

◆ attachResourceParser() [1/2]

void mlir::ParserConfig::attachResourceParser ( std::unique_ptr< AsmResourceParser parser)
inline

Attach the given resource parser.

Definition at line 412 of file AsmState.h.

References value.

Referenced by mlir::attachPassReproducerAsmResource().

◆ attachResourceParser() [2/2]

template<typename CallableT >
std::enable_if_t<std::is_convertible< CallableT, function_ref<LogicalResult(AsmParsedResourceEntry &)> >::value> mlir::ParserConfig::attachResourceParser ( StringRef  name,
CallableT &&  parserFn 
)
inline

Attach the given callable resource parser with the given name.

Definition at line 424 of file AsmState.h.

References mlir::AsmResourceParser::fromCallable().

◆ getContext()

MLIRContext* mlir::ParserConfig::getContext ( ) const
inline

Return the MLIRContext to be used when parsing.

Definition at line 402 of file AsmState.h.

Referenced by mlir::detail::Parser::getContext(), mlir::parseAsmSourceFile(), mlir::detail::parseSourceFile(), and mlir::parseSourceString().

◆ getResourceParser()

AsmResourceParser* mlir::ParserConfig::getResourceParser ( StringRef  name) const
inline

Return the resource parser registered to the given name, or nullptr if no parser with name is registered.

Definition at line 406 of file AsmState.h.


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