16 size_t depth()
const {
return depth_; }
18 const auto&
children()
const {
return children_; }
24 parent->children_.emplace_back(
this);
30 DepNode* parent_ =
nullptr;
31 std::vector<DepNode*> children_;
40 , root_(
std::make_unique<
DepNode>(nullptr, 0)) {
53 static void adjust_depth(
DepNode* node,
size_t depth);
56 std::unique_ptr<DepNode> root_;
59 std::deque<DepNode*> stack_;
DepNode(Def *mut, size_t depth)
const auto & children() const
const DepNode * mut2node(Def *mut) const
bool depends(Def *a, Def *b) const
Does a depend on b?
const DepNode * root() const
The World represents the whole program and manages creation of Thorin nodes (Defs).
GIDMap< Def *, To > MutMap
GIDSet< const Var * > VarSet
GIDMap< const Def *, To > DefMap