FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
freetensor::StmtOrExprID Class Reference

#include <ast.h>

Public Member Functions

 StmtOrExprID ()
 
 StmtOrExprID (const ID &stmtId)
 
 StmtOrExprID (const Expr &expr, const ID &stmtId)
 
template<std::convertible_to< Stmt > T>
 StmtOrExprID (const Expr &expr, T &&parent)
 
const IDstmtId () const
 
const Exprexpr () const
 
bool isValid () const
 

Friends

struct ::std::hash< StmtOrExprID >
 
std::ostream & operator<< (std::ostream &os, const StmtOrExprID &id)
 
bool operator== (const StmtOrExprID &lhs, const StmtOrExprID &rhs)
 

Detailed Description

Identify an Stmt or Expr acrossing passes, so we do not need to pass pointers

An Expr is identified by the hash of itself, combined with the string-typed ID of the Stmt its in, so that any identical Expr in the same Stmt is treated as the same node

Constructor & Destructor Documentation

◆ StmtOrExprID() [1/4]

freetensor::StmtOrExprID::StmtOrExprID ( )
inline

◆ StmtOrExprID() [2/4]

freetensor::StmtOrExprID::StmtOrExprID ( const ID stmtId)
inline

◆ StmtOrExprID() [3/4]

freetensor::StmtOrExprID::StmtOrExprID ( const Expr expr,
const ID stmtId 
)
inline

◆ StmtOrExprID() [4/4]

template<std::convertible_to< Stmt > T>
freetensor::StmtOrExprID::StmtOrExprID ( const Expr expr,
T &&  parent 
)
inline

Member Function Documentation

◆ expr()

const Expr & freetensor::StmtOrExprID::expr ( ) const
inline

◆ isValid()

bool freetensor::StmtOrExprID::isValid ( ) const
inline

◆ stmtId()

const ID & freetensor::StmtOrExprID::stmtId ( ) const
inline

Friends And Related Function Documentation

◆ ::std::hash< StmtOrExprID >

friend struct ::std::hash< StmtOrExprID >
friend

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const StmtOrExprID id 
)
friend

◆ operator==

bool operator== ( const StmtOrExprID lhs,
const StmtOrExprID rhs 
)
friend

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