MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::plug::clos::phase::FreeDefAna Class Reference

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 DefSetrun (Lam *lam)
 Returns the free defs lam has to capture; see the class description.

Detailed 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.

Constructor & Destructor Documentation

◆ FreeDefAna()

mim::plug::clos::phase::FreeDefAna::FreeDefAna ( World & world)
inline

Definition at line 23 of file clos_conv.h.

Member Function Documentation

◆ run()

const DefSet & mim::plug::clos::phase::FreeDefAna::run ( Lam * lam)

Returns the free defs lam has to capture; see the class description.

Definition at line 105 of file clos_conv.cpp.


The documentation for this class was generated from the following files: