Builds a nesting tree for all mutables/binders. More...
#include <mim/nest.h>
Classes | |
| class | Node |
Public Member Functions | |
Constructors | |
| Nest (Def *root) | |
| Nest (World &, fe::View< Def * > muts, bool transitive=false) | |
Virtual root with muts as children; transitive also adds the closed mutables they reach. | |
| Nest (World &) | |
| Virtual root with all World::externals as children. | |
| Nest (const Nest &)=delete | |
| Nest (Nest &&)=delete | |
| Nest & | operator= (Nest)=delete |
Getters | |
| World & | world () const |
| const Node * | root () const |
| Vars | vars () const |
| All Vars occurring in this Nest. | |
| bool | contains (const Def *def) const |
| bool | is_recursive () const |
Nodes | |
| auto | muts () const |
| auto | nodes () const |
| const Node * | operator[] (Def *mut) const |
| const Node * | inest (const Def *def) const |
The innermost Node binding a free Var of def, or the root() if there is none. | |
Iterators | |
| auto | begin () const |
| auto | end () const |
dot | |
GraphViz output. | |
| void | dot (std::ostream &os, DotConfig cfg={}) const |
| void | dot (const char *file=nullptr, DotConfig cfg={}) const |
| void | dot (std::string s, DotConfig cfg={}) const |
Static Public Member Functions | |
| static const Node * | lca (const Node *n, const Node *m) |
Least common ancestor of n and m. | |
Builds a nesting tree for all mutables/binders.
The constructor also computes sibling dependencies, SCCs, loop depths, and dominance. A Nest is immutable afterwards.
| mim::Nest::Nest | ( | Def * | root | ) |
Definition at line 9 of file nest.cpp.
References world().
Referenced by mim::plug::clos::phase::ClosConvPrep::analyze(), mim::plug::mem::phase::FreeLocals::analyze(), Nest(), Nest(), Nest(), and operator=().
| mim::Nest::Nest | ( | World & | world | ) |
Virtual root with all World::externals as children.
|
delete |
References Nest().
|
delete |
References Nest().
|
inline |
Definition at line 197 of file nest.h.
References mim::Def::has_free_vars_in(), and vars().
Referenced by mim::Scheduler::Scheduler().
| void mim::Nest::dot | ( | const char * | file = nullptr, |
| DotConfig | cfg = {} ) const |
| void mim::Nest::dot | ( | std::ostream & | os, |
| DotConfig | cfg = {} ) const |
Definition at line 281 of file dot.cpp.
References mim::DotConfig::dark, and root().
|
inline |
|
inline |
Definition at line 198 of file nest.h.
Referenced by mim::LamSpec::rewrite_imm_App().
|
static |
Least common ancestor of n and m.
Definition at line 174 of file nest.cpp.
References mim::Nest::Node::inest().
Referenced by mim::Scheduler::late().
|
inline |
Definition at line 204 of file nest.h.
Referenced by Nest(), and mim::Scheduler::Scheduler().
|
inline |
Definition at line 195 of file nest.h.
Referenced by dot(), mim::Scheduler::early(), mim::Scheduler::late(), and mim::Scheduler::schedule().
|
inline |
|
inline |