MLIR  22.0.0git
Public Member Functions | List of all members
mlir::StateStack Class Reference

#include "mlir/Support/StateStack.h"

Public Member Functions

template<typename T , typename... Args>
void stackPush (Args &&...args)
 Creates a stack frame of type T on StateStack. More...
 
void stackPop ()
 Pops the last element from the StateStack. More...
 
template<typename T >
WalkResult stackWalk (llvm::function_ref< WalkResult(T &)> callback)
 Calls callback for every StateStack frame of type T starting from the top of the stack. More...
 
template<typename T >
T * getStackTop ()
 Get the top instance of frame type T or nullptr if none are found. More...
 

Detailed Description

Definition at line 52 of file StateStack.h.

Member Function Documentation

◆ getStackTop()

template<typename T >
T* mlir::StateStack::getStackTop ( )
inline

Get the top instance of frame type T or nullptr if none are found.

Definition at line 89 of file StateStack.h.

References mlir::WalkResult::interrupt().

◆ stackPop()

void mlir::StateStack::stackPop ( )
inline

Pops the last element from the StateStack.

Definition at line 67 of file StateStack.h.

Referenced by mlir::LLVM::ModuleTranslation::stackPop().

◆ stackPush()

template<typename T , typename... Args>
void mlir::StateStack::stackPush ( Args &&...  args)
inline

Creates a stack frame of type T on StateStack.

T must be derived from StackFrameBase<T> and constructible from the provided arguments. Doing this before entering the region of the op being translated makes the frame available when translating ops within that region.

Definition at line 60 of file StateStack.h.

Referenced by mlir::LLVM::ModuleTranslation::stackPush().

◆ stackWalk()

template<typename T >
WalkResult mlir::StateStack::stackWalk ( llvm::function_ref< WalkResult(T &)>  callback)
inline

Calls callback for every StateStack frame of type T starting from the top of the stack.

Definition at line 72 of file StateStack.h.

References mlir::WalkResult::advance(), mlir::WalkResult::skip(), and mlir::WalkResult::wasInterrupted().

Referenced by mlir::LLVM::ModuleTranslation::stackWalk().


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