MLIR 22.0.0git
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.
LogicalResult write (T entry, DialectBytecodeWriter &writer)
 Callback writer API used in BytecodeWriter, where groups are created and type/attribute components are numbered.

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.

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

Referenced by fromCallable().

◆ ~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>
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 AttrTypeBytecodeWriter(), and write().

Referenced by mlir::BytecodeWriterConfig::attachAttributeCallback(), and mlir::BytecodeWriterConfig::attachTypeCallback().

◆ write() [1/2]

template<class T>
LogicalResult mlir::AttrTypeBytecodeWriter< T >::write ( T 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 write().

◆ write() [2/2]

template<class T>
virtual LogicalResult mlir::AttrTypeBytecodeWriter< T >::write ( T 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 fromCallable(), and write().


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