MimIR 0.1
MimIR is my Intermediate Representation
|
Performs typed closure conversion. More...
#include <mim/plug/clos/phase/clos_conv.h>
Public Member Functions | |
ClosConv (World &world) | |
void | start () override |
Actual entry. | |
Public Member Functions inherited from mim::Phase | |
Phase (World &world, std::string_view name, bool dirty) | |
virtual | ~Phase ()=default |
World & | world () |
std::string_view | name () const |
bool | is_dirty () const |
virtual void | run () |
Entry point and generates some debug output; invokes Phase::start. | |
Additional Inherited Members | |
Static Public Member Functions inherited from mim::Phase | |
template<class P , class... Args> | |
static void | run (Args &&... args) |
Runs a single Phase. | |
Protected Member Functions inherited from mim::Phase | |
Protected Attributes inherited from mim::Phase | |
World & | world_ |
std::string | name_ |
bool | dirty_ |
Performs typed closure conversion.
This is based on the Simply Typed Closure Conversion. Closures are represented using tuples: [Env: *, Cn [Env, Args..], Env]
. In general only continuations are converted. Different kind of Lams may be rewritten differently:
This pass relies on ClosConvPrep to introduce annotations for these cases.
Note: Since direct-style Defs are not rewritten, this can lead to problems with certain Axioms: ax : (B : *, int -> B) -> (int -> B)
won't be converted, possible arguments may. Further, there is no machinery to handle free variables in a Lams type; this may lead to problems with polymorphic functions.
Definition at line 91 of file clos_conv.h.
|
inline |
Definition at line 93 of file clos_conv.h.
|
overridevirtual |
Actual entry.
Implements mim::Phase.
Definition at line 107 of file clos_conv.cpp.
References mim::Vector(), and mim::Phase::world().