MLIR 22.0.0git
mlir::AttrTypeReplacer Class Reference

This is an attribute/type replacer that is naively cached. More...

#include "mlir/IR/AttrTypeSubElements.h"

Inheritance diagram for mlir::AttrTypeReplacer:

Public Member Functions

Attribute replace (Attribute attr)
Type replace (Type type)
Public Member Functions inherited from mlir::detail::AttrTypeReplacerBase< AttrTypeReplacer >
void addReplacement (ReplaceFn< Attribute > fn)
 AttrTypeReplacerBase.
void addReplacement (ReplaceFn< Type > fn)
void replaceElementsIn (Operation *op, bool replaceAttrs=true, bool replaceLocs=false, bool replaceTypes=false)
 Replace the elements within the given operation.
void recursivelyReplaceElementsIn (Operation *op, bool replaceAttrs=true, bool replaceLocs=false, bool replaceTypes=false)
 Replace the elements within the given operation, and all nested operations.

Additional Inherited Members

Public Types inherited from mlir::detail::AttrTypeReplacerBase< AttrTypeReplacer >
using ReplaceFnResult
 A replacement mapping function, which returns either std::nullopt (to signal the element wasn't handled), or a pair of the replacement element and a WalkResult.
using ReplaceFn
Protected Member Functions inherited from mlir::detail::AttrTypeReplacerBase< AttrTypeReplacer >
Attribute replaceBase (Attribute attr)
 Invokes the registered replacement functions from most recently registered to least recently registered until a successful replacement is returned.

Detailed Description

This is an attribute/type replacer that is naively cached.

It is best used when the replacer logic is guaranteed to not contain cycles. Otherwise, any re-occurrence of an in-progress element will be skipped.

Definition at line 235 of file AttrTypeSubElements.h.

Member Function Documentation

◆ replace() [1/2]

Attribute AttrTypeReplacer::replace ( Attribute attr)

Definition at line 251 of file AttrTypeSubElements.cpp.

Referenced by mlir::Attribute::replace(), and mlir::Type::replace().

◆ replace() [2/2]

Type AttrTypeReplacer::replace ( Type type)

Definition at line 255 of file AttrTypeSubElements.cpp.


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