FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
freetensor::ExprNode Class Referenceabstract

#include <ast.h>

Inheritance diagram for freetensor::ExprNode:
Inheritance graph
[legend]
Collaboration diagram for freetensor::ExprNode:
Collaboration graph
[legend]

Public Member Functions

bool isExpr () const override
 
virtual bool isConst () const
 
virtual bool isBinary () const
 
virtual bool isUnary () const
 
virtual std::vector< Ref< ExprNode > > children () const =0
 
Ref< ExprNodeparentExpr () const
 
Ref< StmtNodeparentStmt () const
 
void modifiedHook () override
 
DataType dtype ()
 
void resetDType ()
 
virtual void inferDType ()=0
 
 DEFINE_NODE_ACCESS (Expr)
 
- Public Member Functions inherited from freetensor::ASTNode
virtual ~ASTNode ()
 
virtual ASTNodeType nodeType () const =0
 
bool isAST () const override
 
virtual bool isFunc () const
 
virtual bool isStmt () const
 
virtual bool isExpr () const
 
Ref< ASTNodeparentAST () const
 
std::source_location debugBlame () const
 
void setDebugBlame (std::source_location loc)
 
 DEFINE_NODE_ACCESS (AST)
 
- Public Member Functions inherited from freetensor::ASTPart
virtual ~ASTPart ()
 
 ASTPart (ASTPart &&other)
 
 ASTPart (const ASTPart &other)
 
ASTPartoperator= (ASTPart &&)
 
ASTPartoperator= (const ASTPart &)
 
bool trySetParent (const Ref< ASTPart > &parent)
 
void resetParent ()
 
Ref< ASTPartparent () const
 
bool isSubTree () const
 
int depth () const
 
virtual void modifiedHook ()
 
size_t hash ()
 
virtual bool isAST () const
 
- Public Member Functions inherited from freetensor::EnableSelf< ASTPart >
Ref< ASTPartself () const
 

Protected Attributes

std::optional< DataTypedtype_
 
- Protected Attributes inherited from freetensor::ASTPart
size_t hash_ = ~0ull
 
std::atomic_flag lock_ = ATOMIC_FLAG_INIT
 

Additional Inherited Members

- Public Types inherited from freetensor::EnableSelf< ASTPart >
typedef ASTPart Self
 
- Protected Member Functions inherited from freetensor::ASTPart
void lock ()
 
void unlock ()
 
virtual void compHash ()=0
 
void resetHash ()
 

Detailed Description

Base class of all expression nodes in an AST

Member Function Documentation

◆ children()

virtual std::vector< Ref< ExprNode > > freetensor::ExprNode::children ( ) const
pure virtual

◆ DEFINE_NODE_ACCESS()

freetensor::ExprNode::DEFINE_NODE_ACCESS ( Expr  )

◆ dtype()

DataType freetensor::ExprNode::dtype ( )

◆ inferDType()

virtual void freetensor::ExprNode::inferDType ( )
pure virtual

◆ isBinary()

virtual bool freetensor::ExprNode::isBinary ( ) const
inlinevirtual

Reimplemented in freetensor::BinaryExprNode.

◆ isConst()

virtual bool freetensor::ExprNode::isConst ( ) const
inlinevirtual

Reimplemented in freetensor::ConstNode.

◆ isExpr()

bool freetensor::ExprNode::isExpr ( ) const
inlineoverridevirtual

Reimplemented from freetensor::ASTNode.

◆ isUnary()

virtual bool freetensor::ExprNode::isUnary ( ) const
inlinevirtual

Reimplemented in freetensor::UnaryExprNode.

◆ modifiedHook()

void freetensor::ExprNode::modifiedHook ( )
inlineoverridevirtual

Called when a SubTree of ASTPart is modified

You can override this hook to clear some internal states of an ASTPart. Remember to call the base class' hook

This hook is NOT thread-safe

Reimplemented from freetensor::ASTPart.

◆ parentExpr()

Expr freetensor::ExprNode::parentExpr ( ) const

◆ parentStmt()

Stmt freetensor::ExprNode::parentStmt ( ) const

◆ resetDType()

void freetensor::ExprNode::resetDType ( )

Member Data Documentation

◆ dtype_

std::optional<DataType> freetensor::ExprNode::dtype_
protected

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