MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::AsmResourcePrinter Class Referenceabstract

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

#include "mlir/IR/AsmState.h"

Public Member Functions

 AsmResourcePrinter (StringRef name)
 Create a new printer with the given identifying name. More...
 
virtual ~AsmResourcePrinter ()
 
StringRef getName () const
 Return the name of this printer. More...
 
virtual void buildResources (Operation *op, AsmResourceBuilder &builder) const =0
 Build any resources to include during printing, utilizing the given top-level root operation to help determine what information to include. More...
 

Static Public Member Functions

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

Detailed Description

This class represents an instance of a resource printer.

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

Definition at line 377 of file AsmState.h.

Constructor & Destructor Documentation

◆ AsmResourcePrinter()

mlir::AsmResourcePrinter::AsmResourcePrinter ( StringRef  name)
inline

Create a new printer with the given identifying name.

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

Definition at line 382 of file AsmState.h.

Referenced by fromCallable().

◆ ~AsmResourcePrinter()

AsmResourcePrinter::~AsmResourcePrinter ( )
virtualdefault

Member Function Documentation

◆ buildResources()

virtual void mlir::AsmResourcePrinter::buildResources ( Operation op,
AsmResourceBuilder builder 
) const
pure virtual

Build any resources to include during printing, utilizing the given top-level root operation to help determine what information to include.

Provided data should be registered in the form of a key/data pair, to the given builder.

Referenced by fromCallable().

◆ fromCallable()

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

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

Definition at line 398 of file AsmState.h.

References AsmResourcePrinter(), and buildResources().

Referenced by mlir::BytecodeWriterConfig::attachResourcePrinter(), mlir::AsmState::attachResourcePrinter(), and mlir::FallbackAsmResourceMap::getPrinters().

◆ getName()

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

Return the name of this printer.

Definition at line 386 of file AsmState.h.


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