MLIR 22.0.0git
mlir::OpBuilder::Listener Struct Reference

This class represents a listener that may be used to hook into various actions within an OpBuilder. More...

#include "mlir/IR/Builders.h"

Inheritance diagram for mlir::OpBuilder::Listener:

Public Member Functions

 Listener ()
virtual ~Listener ()=default
virtual void notifyOperationInserted (Operation *op, InsertPoint previous)
 Notify the listener that the specified operation was inserted.
virtual void notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt)
 Notify the listener that the specified block was inserted.
Public Member Functions inherited from mlir::OpBuilder::ListenerBase
Kind getKind () const

Protected Member Functions

 Listener (Kind kind)
Protected Member Functions inherited from mlir::OpBuilder::ListenerBase
 ListenerBase (Kind kind)

Additional Inherited Members

Public Types inherited from mlir::OpBuilder::ListenerBase
enum class  Kind { OpBuilderListener = 0 , RewriterBaseListener = 1 }
 The kind of listener. More...

Detailed Description

This class represents a listener that may be used to hook into various actions within an OpBuilder.

Definition at line 285 of file Builders.h.

Constructor & Destructor Documentation

◆ Listener() [1/2]

mlir::OpBuilder::Listener::Listener ( )
inline

◆ ~Listener()

virtual mlir::OpBuilder::Listener::~Listener ( )
virtualdefault

◆ Listener() [2/2]

mlir::OpBuilder::Listener::Listener ( Kind kind)
inlineprotected

Definition at line 312 of file Builders.h.

References mlir::OpBuilder::ListenerBase::ListenerBase().

Member Function Documentation

◆ notifyBlockInserted()

virtual void mlir::OpBuilder::Listener::notifyBlockInserted ( Block * block,
Region * previous,
Region::iterator previousIt )
inlinevirtual

Notify the listener that the specified block was inserted.

  • If the block was moved, then previous and previousIt are the previous location of the block.
  • If the block was unlinked before it was inserted, then previous is "nullptr".

Note: Creating an (unlinked) block does not trigger this notification.

Reimplemented in mlir::detail::ConversionPatternRewriterImpl, and mlir::RewriterBase::ForwardingListener.

Definition at line 308 of file Builders.h.

Referenced by notifyBlockInsertions().

◆ notifyOperationInserted()

virtual void mlir::OpBuilder::Listener::notifyOperationInserted ( Operation * op,
InsertPoint previous )
inlinevirtual

Notify the listener that the specified operation was inserted.

  • If the operation was moved, then previous is the previous location of the op.
  • If the operation was unlinked before it was inserted, then previous is empty.

Note: Creating an (unlinked) op does not trigger this notification.

Reimplemented in mlir::detail::ConversionPatternRewriterImpl, mlir::RewriterBase::ForwardingListener, and mlir::RewriterBase::PatternLoggingListener.

Definition at line 298 of file Builders.h.

Referenced by createAsyncDispatchFunction(), and createParallelComputeFunction().


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