|
FreeTensor
|
#include <sub_tree.h>


Public Member Functions | |
| virtual | ~ASTPart () |
| ASTPart (ASTPart &&other) | |
| ASTPart (const ASTPart &other) | |
| ASTPart & | operator= (ASTPart &&) |
| ASTPart & | operator= (const ASTPart &) |
| bool | trySetParent (const Ref< ASTPart > &parent) |
| void | resetParent () |
| Ref< ASTPart > | parent () 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< ASTPart > | self () const |
Protected Member Functions | |
| void | lock () |
| void | unlock () |
| virtual void | compHash ()=0 |
| void | resetHash () |
Protected Attributes | |
| size_t | hash_ = ~0ull |
| std::atomic_flag | lock_ = ATOMIC_FLAG_INIT |
Additional Inherited Members | |
Public Types inherited from freetensor::EnableSelf< ASTPart > | |
| typedef ASTPart | Self |
The basic building block of an AST
A ASTPart can be derived as an ASTNode, or other classes that is a part of an ASTNode. ASTPart automatically manage the memory of the AST, and tracking each ASTPart's parent, as long as each ASTPart is "plugged in" a SubTree of its parent
An ASTPart must be constructed via factory functions like makeXXX, instead of a custom constructor. This is because the self() will be used to initialize is children, but self() is only available when a Ref of the ASTPart is present, after the ASTPart is constructed.
Read members from an ASTPart is thread-safe (even it computes hash). Write to members of an ASTPart is NOT thread-safe
|
inlinevirtual |
|
inline |
|
inline |
|
protectedpure virtual |
Implemented in freetensor::Buffer, freetensor::CutlassMicroKernelProperty, freetensor::AnyExprNode, freetensor::VarNode, freetensor::LoadNode, freetensor::IntConstNode, freetensor::FloatConstNode, freetensor::BoolConstNode, freetensor::CommutativeBinaryExprNode, freetensor::NonCommutativeBinaryExprNode, freetensor::UnaryExprNode, freetensor::IfExprNode, freetensor::CastNode, freetensor::IntrinsicNode, freetensor::LoadAtVersionNode, freetensor::ReductionItem, freetensor::ForProperty, freetensor::FuncNode, freetensor::AnyNode, freetensor::StmtSeqNode, freetensor::VarDefNode, freetensor::StoreNode, freetensor::AllocNode, freetensor::FreeNode, freetensor::ReduceToNode, freetensor::ForNode, freetensor::IfNode, freetensor::AssertNode, freetensor::AssumeNode, freetensor::EvalNode, freetensor::MatMulNode, freetensor::MarkVersionNode, and freetensor::Tensor.
| int freetensor::ASTPart::depth | ( | ) | const |
How many ancestors this ASTPart has. Counting from 0
This value is not cached. Please count it as few as possible
| size_t freetensor::ASTPart::hash | ( | ) |
|
inlinevirtual |
Reimplemented in freetensor::ASTNode.
|
inline |
|
inlineprotected |
|
inlinevirtual |
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 in freetensor::ExprNode.
|
protected |
|
inline |
|
inlineprotected |
|
protected |
|
protected |