MLIR
20.0.0git
|
This class represents a configuration for the MLIR assembly parser. More...
#include "mlir/IR/AsmState.h"
Public Member Functions | |
ParserConfig (MLIRContext *context, bool verifyAfterParse=true, FallbackAsmResourceMap *fallbackResourceMap=nullptr) | |
Construct a parser configuration with the given context. More... | |
MLIRContext * | getContext () const |
Return the MLIRContext to be used when parsing. More... | |
bool | shouldVerifyAfterParse () const |
Returns if the parser should verify the IR after parsing. More... | |
BytecodeReaderConfig & | getBytecodeReaderConfig () const |
Returns the parsing configurations associated to the bytecode read. More... | |
AsmResourceParser * | getResourceParser (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 &)> >::value > | attachResourceParser (StringRef name, CallableT &&parserFn) |
Attach the given callable resource parser with the given name. More... | |
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 467 of file AsmState.h.
|
inline |
Construct a parser configuration with the given context.
verifyAfterParse
indicates if the IR should be verified after parsing. fallbackResourceMap
is an optional fallback handler that can be used to parse external resources not explicitly handled by another parser.
Definition at line 473 of file AsmState.h.
|
inline |
Attach the given resource parser.
Definition at line 503 of file AsmState.h.
Referenced by mlir::PassReproducerOptions::attachResourceParser(), and attachResourceParser().
|
inline |
Attach the given callable resource parser with the given name.
Definition at line 515 of file AsmState.h.
References attachResourceParser(), and mlir::AsmResourceParser::fromCallable().
|
inline |
Returns the parsing configurations associated to the bytecode read.
Definition at line 487 of file AsmState.h.
|
inline |
Return the MLIRContext to be used when parsing.
Definition at line 481 of file AsmState.h.
Referenced by mlir::BytecodeReader::BytecodeReader(), mlir::detail::Parser::getContext(), mlir::parseAsmSourceFile(), mlir::detail::parseSourceFile(), mlir::parseSourceString(), and readBytecodeFileImpl().
|
inline |
Return the resource parser registered to the given name, or nullptr if no parser with name
is registered.
Definition at line 493 of file AsmState.h.
References mlir::FallbackAsmResourceMap::getParserFor().
|
inline |
Returns if the parser should verify the IR after parsing.
Definition at line 484 of file AsmState.h.