MLIR  20.0.0git
Public Member Functions | Protected Member Functions | List of all members
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. More...
 
virtual void notifyBlockInserted (Block *block, Region *previous, Region::iterator previousIt)
 Notify the listener that the specified block was inserted. More...
 
- 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 293 of file Builders.h.

Constructor & Destructor Documentation

◆ Listener() [1/2]

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

Definition at line 294 of file Builders.h.

◆ ~Listener()

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

◆ Listener() [2/2]

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

Definition at line 320 of file Builders.h.

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 316 of file Builders.h.

Referenced by mlir::OpBuilder::cloneRegionBefore(), mlir::OpBuilder::createBlock(), mlir::RewriterBase::moveBlockBefore(), and mlir::RewriterBase::ForwardingListener::notifyBlockInserted().

◆ 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, and mlir::RewriterBase::ForwardingListener.

Definition at line 306 of file Builders.h.

Referenced by mlir::OpBuilder::clone(), mlir::OpBuilder::cloneRegionBefore(), createAsyncDispatchFunction(), createParallelComputeFunction(), mlir::OpBuilder::insert(), mlir::RewriterBase::moveOpBefore(), and mlir::RewriterBase::ForwardingListener::notifyOperationInserted().


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