Computes, on demand and with memoization, the free Defs that a Lam must capture in its closure environment. More...
#include <mim/plug/clos/phase/clos_conv.h>
Public Member Functions | |
| FreeDefAna (World &world) | |
| const DefSet & | run (Lam *lam) |
Returns the free defs lam has to capture; see the class description. | |
Computes, on demand and with memoization, the free Defs that a Lam must capture in its closure environment.
A referenced nested mutable does not become a free def itself; instead it contributes its free defs, since it will be closure-converted too. This makes the free-def sets of (mutually) recursive Lams inter-dependent, so they are solved to a fixed point over a little dependency graph: an edge pred → node means node must include all of pred's free defs.
Mutables are only treated as free defs directly if annotated with clos::attr::free_bb / clos::attr::fstclass_bb; immutables carrying free vars are broken down to their relevant leaves.
Definition at line 21 of file clos_conv.h.
|
inline |
Definition at line 23 of file clos_conv.h.
Returns the free defs lam has to capture; see the class description.
Definition at line 105 of file clos_conv.cpp.