MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::AttrTypeBytecodeWriter< T > Class Template Referenceabstract

A class to interact with the attributes and types printer when emitting MLIR bytecode. More...

#include "mlir/Bytecode/BytecodeWriter.h"

Public Member Functions

 AttrTypeBytecodeWriter ()=default
 
virtual ~AttrTypeBytecodeWriter ()=default
 
virtual LogicalResult write (T entry, std::optional< StringRef > &name, DialectBytecodeWriter &writer)=0
 Callback writer API used in IRNumbering, where groups are created and type/attribute components are numbered. More...
 
LogicalResult write (T entry, DialectBytecodeWriter &writer)
 Callback writer API used in BytecodeWriter, where groups are created and type/attribute components are numbered. More...
 

Static Public Member Functions

template<typename CallableT , std::enable_if_t< std::is_convertible_v< CallableT, std::function< LogicalResult(T, std::optional< StringRef > &, DialectBytecodeWriter &)>> , bool >
static std::unique_ptr< AttrTypeBytecodeWriter< T > > fromCallable (CallableT &&writeFn)
 Return an Attribute/Type printer implemented via the given callable, whose form should match that of the write function above. More...
 

Detailed Description

template<class T>
class mlir::AttrTypeBytecodeWriter< T >

A class to interact with the attributes and types printer when emitting MLIR bytecode.

Definition at line 27 of file BytecodeWriter.h.

Constructor & Destructor Documentation

◆ AttrTypeBytecodeWriter()

template<class T >
mlir::AttrTypeBytecodeWriter< T >::AttrTypeBytecodeWriter ( )
default

◆ ~AttrTypeBytecodeWriter()

template<class T >
virtual mlir::AttrTypeBytecodeWriter< T >::~AttrTypeBytecodeWriter ( )
virtualdefault

Member Function Documentation

◆ fromCallable()

template<class T >
template<typename CallableT , std::enable_if_t< std::is_convertible_v< CallableT, std::function< LogicalResult(T, std::optional< StringRef > &, DialectBytecodeWriter &)>> , bool >
static std::unique_ptr<AttrTypeBytecodeWriter<T> > mlir::AttrTypeBytecodeWriter< T >::fromCallable ( CallableT &&  writeFn)
inlinestatic

Return an Attribute/Type printer implemented via the given callable, whose form should match that of the write function above.

Definition at line 57 of file BytecodeWriter.h.

References mlir::AttrTypeBytecodeWriter< T >::AttrTypeBytecodeWriter(), and mlir::AttrTypeBytecodeWriter< T >::write().

◆ write() [1/2]

template<class T >
LogicalResult mlir::AttrTypeBytecodeWriter< T >::write ( entry,
DialectBytecodeWriter writer 
)
inline

Callback writer API used in BytecodeWriter, where groups are created and type/attribute components are numbered.

Here, DialectBytecodeWriter is expected to be an actual writer. The optional stringref specified by the user is ignored, since the group was already specified when numbering the IR.

Definition at line 43 of file BytecodeWriter.h.

References mlir::AttrTypeBytecodeWriter< T >::write().

◆ write() [2/2]

template<class T >
virtual LogicalResult mlir::AttrTypeBytecodeWriter< T >::write ( entry,
std::optional< StringRef > &  name,
DialectBytecodeWriter writer 
)
pure virtual

Callback writer API used in IRNumbering, where groups are created and type/attribute components are numbered.

At this stage, writer is expected to be a NumberingDialectWriter.

Referenced by mlir::AttrTypeBytecodeWriter< T >::fromCallable(), and mlir::AttrTypeBytecodeWriter< T >::write().


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