35 using NodeQueue = std::queue<Node*>;
36 using Nodes = std::vector<Node*>;
47 auto add_fvs(
const Def* def) {
49 return fvs.emplace(def);
55 bool is_bot(Node* node) {
return node->pass_id == 0; }
58 bool is_done(Node* node) {
return !is_bot(node) && node->pass_id < cur_pass_id; }
61 void mark(Node* node) { node->pass_id = cur_pass_id; }
64 void split_fd(Node* node,
const Def* fv,
bool& is_init, NodeQueue& worklist);
66 std::pair<Node*, bool> build_node(Def* mut, NodeQueue& worklist);
67 void run(NodeQueue& worklist);
69 World& world() {
return world_; }
97 void start()
override;
118 const Pi* rewrite_type_cn(
const Pi*,
Def2Def& subst);
119 const Def* type_clos(
const Pi* pi,
Def2Def& subst,
const Def* ent_type =
nullptr);
130 std::queue<const Def*> worklist_;
As opposed to a Pass, a Phase does one thing at a time and does not mix with other Phases.
A dependent function type.
The World represents the whole program and manages creation of MimIR nodes (Defs).
Performs typed closure conversion.
void start() override
Actual entry.
Transitively compute free Def's on demand.
DefSet & run(Lam *lam)
FreeDefAna::run will compute free defs (FD) that appear in lams body.
DefMap< const Def * > Def2Def
GIDMap< const Def *, To > DefMap
GIDSet< const Def * > DefSet