MLIR  20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
Visitors.h File Reference
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/STLExtras.h"

Go to the source code of this file.

Classes

class  mlir::WalkResult
 A utility result that is used to signal how to proceed with an ongoing walk: More...
 
struct  mlir::ForwardIterator
 This iterator enumerates the elements in "forward" order. More...
 
class  mlir::WalkStage
 A utility class to encode the current walk stage for "generic" walkers. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::detail
 AttrTypeReplacer.
 

Typedefs

template<typename T >
using mlir::detail::first_argument = decltype(first_argument_type(std::declval< T >()))
 Type definition of the first argument to the given callable 'T'. More...
 
template<typename FnT >
using mlir::detail::walkResultType = decltype(walk(nullptr, std::declval< FnT >()))
 Utility to provide the return type of a templated walk method. More...
 

Enumerations

enum class  mlir::WalkOrder { mlir::PreOrder , mlir::PostOrder }
 Traversal order for region, block and operation walk utilities. More...
 

Functions

template<typename Ret , typename Arg , typename... Rest>
Arg mlir::detail::first_argument_type (Ret(*)(Arg, Rest...))
 Helper templates to deduce the first argument of a callback parameter. More...
 
template<typename Ret , typename F , typename Arg , typename... Rest>
Arg mlir::detail::first_argument_type (Ret(F::*)(Arg, Rest...))
 
template<typename Iterator >
void mlir::detail::walk (Operation *op, function_ref< void(Region *)> callback, WalkOrder order)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
template<typename Iterator >
void mlir::detail::walk (Operation *op, function_ref< void(Block *)> callback, WalkOrder order)
 
template<typename Iterator >
void mlir::detail::walk (Operation *op, function_ref< void(Operation *)> callback, WalkOrder order)
 
template<typename Iterator >
WalkResult mlir::detail::walk (Operation *op, function_ref< WalkResult(Region *)> callback, WalkOrder order)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
template<typename Iterator >
WalkResult mlir::detail::walk (Operation *op, function_ref< WalkResult(Block *)> callback, WalkOrder order)
 
template<typename Iterator >
WalkResult mlir::detail::walk (Operation *op, function_ref< WalkResult(Operation *)> callback, WalkOrder order)
 
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value &&std::is_same< RetT, void >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value &&std::is_same< RetT, WalkResult >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
void mlir::detail::walk (Operation *op, function_ref< void(Operation *, const WalkStage &stage)> callback)
 Generic walkers with stage aware callbacks. More...
 
WalkResult mlir::detail::walk (Operation *op, function_ref< WalkResult(Operation *, const WalkStage &stage)> callback)
 Walk all the operations nested under (and including) the given operation, with the callback being invoked on each operation N+1 times, where N is the number of regions attached to the operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t< std::is_same< ArgT, Operation * >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the operations nested under and including the given operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same< ArgT, Operation * >::value &&std::is_same< RetT, void >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same< ArgT, Operation * >::value &&std::is_same< RetT, WalkResult >::value, RetT > mlir::detail::walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 

Variables

template<typename F >
decltype(first_argument_type(&F::operator())) mlir::detail::first_argument_type (F)