5void ParentMapAnalysis::dfs(
const Node *N,
const Node *Parent) {
8 ParentMap.insert({N, Parent});
14 return ParentMap.contains(&N) ? ParentMap.at(&N) :
nullptr;
34 return upTo(*Up, Kind);
47 return isRoot(query(N), N);
static bool isExpr(NodeKind Kind)
virtual ChildVector children() const =0
const Node * upExpr(const Node &N) const
Search up until the node becomes a concrete expression. a ^<--— ID -> ExprVar.
static bool isRoot(const Node *Up, const Node &N)
const Node * upTo(const Node &N, Node::NodeKind Kind) const
Search up until some kind of node is found.
void runOnAST(const Node &Root)
const Node * query(const Node &N) const