FreeTensor
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
freetensor::TrackStmt< BaseClass > Class Template Reference

#include <track_stmt.h>

Inheritance diagram for freetensor::TrackStmt< BaseClass >:
Inheritance graph
[legend]
Collaboration diagram for freetensor::TrackStmt< BaseClass >:
Collaboration graph
[legend]

Protected Member Functions

void pushStmt (const Stmt &op)
 
void popStmt (const Stmt &)
 
const StmtcurStmt () const
 
BaseClass::StmtRetType visitStmt (const Stmt &op) override
 

Detailed Description

template<class BaseClass>
class freetensor::TrackStmt< BaseClass >

A context for Visitor or Mutator that tracks the visiting statements stack

Inherit this class to use. E.g., inherit TrackStmt<Visitor> or TrackStmt<Mutator>

This class will automatically maintains the statement stack if the sub-class calls TrackStmt::visitStmt, which is the suggested usage

However, in some cases, this is impossible, e.g., when the sub-class needs to recurse into different sub-trees manually. In these cases, the sub-class should explicitly call the pushStmt / popStmt methods

Member Function Documentation

◆ curStmt()

template<class BaseClass >
const Stmt & freetensor::TrackStmt< BaseClass >::curStmt ( ) const
inlineprotected

◆ popStmt()

template<class BaseClass >
void freetensor::TrackStmt< BaseClass >::popStmt ( const Stmt )
inlineprotected

◆ pushStmt()

template<class BaseClass >
void freetensor::TrackStmt< BaseClass >::pushStmt ( const Stmt op)
inlineprotected

◆ visitStmt()

template<class BaseClass >
BaseClass::StmtRetType freetensor::TrackStmt< BaseClass >::visitStmt ( const Stmt op)
inlineoverrideprotected

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