MLIR
20.0.0git
|
#include "mlir/IR/AttrTypeSubElements.h"
Public Types | |
template<typename T > | |
using | WalkFn = std::function< WalkResult(T)> |
Public Member Functions | |
template<WalkOrder Order, typename T > | |
WalkResult | walk (T element) |
Walk the given attribute/type, and recursively walk any sub elements. More... | |
template<typename T > | |
WalkResult | walk (T element) |
void | addWalk (WalkFn< Attribute > &&fn) |
Register a walk function for a given attribute or type. More... | |
void | addWalk (WalkFn< Type > &&fn) |
template<typename FnT , typename T = typename llvm::function_traits< std::decay_t<FnT>>::template arg_t<0>, typename BaseT = std::conditional_t<std::is_base_of_v<Attribute, T>, Attribute, Type>, typename ResultT = std::invoke_result_t<FnT, T>> | |
std::enable_if_t<!std::is_same_v< T, BaseT >||std::is_same_v< ResultT, void > > | addWalk (FnT &&callback) |
Register a replacement function that doesn't match the default signature, either because it uses a derived parameter type, or it uses a simplified result type. More... | |
This class provides a utility for walking attributes/types, and their sub elements. Multiple walk functions may be registered.
Definition at line 34 of file AttrTypeSubElements.h.
using mlir::AttrTypeWalker::WalkFn = std::function<WalkResult(T)> |
Definition at line 55 of file AttrTypeSubElements.h.
|
inline |
Register a replacement function that doesn't match the default signature, either because it uses a derived parameter type, or it uses a simplified result type.
Definition at line 84 of file AttrTypeSubElements.h.
References addWalk(), and mlir::WalkResult::advance().
Register a walk function for a given attribute or type.
A walk function must be convertible to any of the following forms(where T
is a class derived from Type
or Attribute
:
Note: When walking, the mostly recently added walk functions will be invoked first.
Definition at line 69 of file AttrTypeSubElements.h.
Referenced by addWalk(), deepCloneAliasScopes(), mlir::LocationAttr::walk(), mlir::Attribute::walk(), and mlir::Type::walk().
Definition at line 72 of file AttrTypeSubElements.h.
|
inline |
Walk the given attribute/type, and recursively walk any sub elements.
Definition at line 42 of file AttrTypeSubElements.h.
Referenced by deepCloneAliasScopes(), mlir::LocationAttr::walk(), mlir::Attribute::walk(), and mlir::Type::walk().
|
inline |
Definition at line 46 of file AttrTypeSubElements.h.