|
FreeTensor
|
#include <ast.h>


Public Member Functions | |
| void | setId (const ID &id=ID::make()) |
| ID | id () const |
| const Metadata & | metadata () const |
| Metadata & | metadata () |
| bool | isStmt () const override |
| virtual bool | isCtrlFlow () const |
| virtual std::vector< Ref< StmtNode > > | children () const |
| Ref< StmtNode > | prevLeafStmtInDFSOrder () const |
| Ref< StmtNode > | nextLeafStmtInDFSOrder () const |
| Ref< StmtNode > | prevStmtInDFSPostOrder () const |
| Ref< StmtNode > | nextStmtInDFSPreOrder () const |
| Ref< StmtNode > | ancestorById (const ID &lookup) const |
| bool | isAncestorOf (const Stmt &other) const |
| bool | isBefore (const Stmt &other) const |
| DEFINE_NODE_ACCESS (Stmt) | |
| Ref< StmtNode > | parentStmt () const |
| Ref< StmtNode > | parentStmtByFilter (const std::function< bool(const Stmt &)> &filter) const |
| Ref< StmtNode > | prevStmt () const |
| Ref< StmtNode > | nextStmt () const |
| Ref< StmtNode > | parentCtrlFlow () const |
| Ref< StmtNode > | prevInCtrlFlow () const |
| Ref< StmtNode > | nextInCtrlFlow () const |
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< ASTNode > | parentAST () 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) | |
| 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 |
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 () |
Protected Attributes inherited from freetensor::ASTPart | |
| size_t | hash_ = ~0ull |
| std::atomic_flag | lock_ = ATOMIC_FLAG_INIT |
Base class of all statement nodes in an AST
Find an ancestor by ID. this itself is also considered
| freetensor::StmtNode::DEFINE_NODE_ACCESS | ( | Stmt | ) |
| ID freetensor::StmtNode::id | ( | ) | const |
| bool freetensor::StmtNode::isAncestorOf | ( | const Stmt & | other | ) | const |
Check whether this node is an ancestoer of other
| bool freetensor::StmtNode::isBefore | ( | const Stmt & | other | ) | const |
Check whether this node is before other in DFS order
|
inlinevirtual |
For, If and Assert are control flow, while StmtSeq, VarDef and Assume are not
Reimplemented in freetensor::ForNode, freetensor::IfNode, and freetensor::AssertNode.
|
inlineoverridevirtual |
Reimplemented from freetensor::ASTNode.
|
inline |
|
inline |
| Stmt freetensor::StmtNode::nextInCtrlFlow | ( | ) | const |
| Stmt freetensor::StmtNode::nextLeafStmtInDFSOrder | ( | ) | const |
| Stmt freetensor::StmtNode::nextStmt | ( | ) | const |
| Stmt freetensor::StmtNode::nextStmtInDFSPreOrder | ( | ) | const |
| Stmt freetensor::StmtNode::parentCtrlFlow | ( | ) | const |
Parent, next or previous statment, ignoring VarDef, StmtSeq or Assume nodes
| Stmt freetensor::StmtNode::parentStmt | ( | ) | const |
Parent, next or previous statement
NOTE: For an If node, the "then" case is considered before the "else" case
| Ref< StmtNode > freetensor::StmtNode::parentStmtByFilter | ( | const std::function< bool(const Stmt &)> & | filter | ) | const |
| Stmt freetensor::StmtNode::prevInCtrlFlow | ( | ) | const |
| Stmt freetensor::StmtNode::prevLeafStmtInDFSOrder | ( | ) | const |
Previous or next statement in DFS order
| Stmt freetensor::StmtNode::prevStmt | ( | ) | const |
| Stmt freetensor::StmtNode::prevStmtInDFSPostOrder | ( | ) | const |