MLIR
18.0.0git
|
A listener that forwards all notifications to another listener. More...
#include "mlir/IR/PatternMatch.h"
Public Member Functions | |
ForwardingListener (OpBuilder::Listener *listener) | |
void | notifyOperationInserted (Operation *op) override |
Notification handler for when an operation is inserted into the builder. More... | |
void | notifyBlockCreated (Block *block) override |
Notification handler for when a block is created using the builder. More... | |
void | notifyOperationModified (Operation *op) override |
Notify the listener that the specified operation was modified in-place. More... | |
void | notifyOperationReplaced (Operation *op, Operation *newOp) override |
Notify the listener that the specified operation is about to be replaced with another operation. More... | |
void | notifyOperationReplaced (Operation *op, ValueRange replacement) override |
Notify the listener that the specified operation is about to be replaced with the a range of values, potentially produced by other operations. More... | |
void | notifyOperationRemoved (Operation *op) override |
Notify the listener that the specified operation is about to be erased. More... | |
LogicalResult | notifyMatchFailure (Location loc, function_ref< void(Diagnostic &)> reasonCallback) override |
Notify the listener that the pattern failed to match the given operation, and provide a callback to populate a diagnostic with the reason why the failure occurred. More... | |
![]() | |
Listener () | |
![]() | |
Listener () | |
virtual | ~Listener ()=default |
![]() | |
Kind | getKind () const |
Additional Inherited Members | |
![]() | |
enum class | Kind { OpBuilderListener = 0 , RewriterBaseListener = 1 } |
The kind of listener. More... | |
![]() | |
static bool | classof (const OpBuilder::Listener *base) |
![]() | |
Listener (Kind kind) | |
![]() | |
ListenerBase (Kind kind) | |
A listener that forwards all notifications to another listener.
This struct can be used as a base to create listener chains, so that multiple listeners can be notified of IR changes.
Definition at line 446 of file PatternMatch.h.
|
inline |
Definition at line 447 of file PatternMatch.h.
|
inlineoverridevirtual |
Notification handler for when a block is created using the builder.
block
is the block that was created.
Reimplemented from mlir::OpBuilder::Listener.
Definition at line 452 of file PatternMatch.h.
References mlir::OpBuilder::Listener::notifyBlockCreated().
|
inlineoverridevirtual |
Notify the listener that the pattern failed to match the given operation, and provide a callback to populate a diagnostic with the reason why the failure occurred.
This method allows for derived listeners to optionally hook into the reason why a rewrite failed, and display it to users.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 472 of file PatternMatch.h.
References mlir::failure().
|
inlineoverridevirtual |
Notification handler for when an operation is inserted into the builder.
op
is the operation that was inserted.
Reimplemented from mlir::OpBuilder::Listener.
Definition at line 449 of file PatternMatch.h.
|
inlineoverridevirtual |
Notify the listener that the specified operation was modified in-place.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 455 of file PatternMatch.h.
|
inlineoverridevirtual |
Notify the listener that the specified operation is about to be erased.
At this point, the operation has zero uses.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 468 of file PatternMatch.h.
|
inlineoverridevirtual |
Notify the listener that the specified operation is about to be replaced with another operation.
This is called before the uses of the old operation have been changed.
By default, this function calls the "operation replaced with values" notification.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 459 of file PatternMatch.h.
|
inlineoverridevirtual |
Notify the listener that the specified operation is about to be replaced with the a range of values, potentially produced by other operations.
This is called before the uses of the operation have been changed.
Reimplemented from mlir::RewriterBase::Listener.
Definition at line 463 of file PatternMatch.h.