33 using NodeQueue = std::queue<Node*>;
34 using Nodes = std::vector<Node*>;
45 auto add_fvs(
const Def* def) {
47 return fvs.emplace(def);
53 bool is_bot(Node* node) {
return node->pass_id == 0; }
56 bool is_done(Node* node) {
return !is_bot(node) && node->pass_id < cur_pass_id; }
59 void mark(Node* node) { node->pass_id = cur_pass_id; }
62 void split_fd(Node* node,
const Def* fv,
bool& is_init, NodeQueue& worklist);
64 std::pair<Node*, bool> build_node(Def* mut, NodeQueue& worklist);
65 void run(NodeQueue& worklist);
67 World& world() {
return world_; }
95 void start()
override;
116 const Pi* rewrite_type_cn(
const Pi*,
Def2Def& subst);
117 const Def* type_clos(
const Pi* pi,
Def2Def& subst,
const Def* ent_type =
nullptr);
128 std::queue<const Def*> worklist_;
Ref type() const noexcept
Yields the raw type of this Def, i.e. maybe nullptr.
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