Source code
|
| parsing
v
Parsetree
|
| typing
v
Typedtree
|
| desugar pattern matching, modules, objects, etc; erase types,
| make explicit memory layout in terms of blocks and values
|
v
Lambda (higher order lambda calculus based IR)
|
| make closure construction and usage explicit
| perform inlining
|
v
Clambda (like Lambda but with explicit closures, direct/indirect calls)
|
| make block/value manipulation explicit
| make allocation explicit
|
v
Cmm (tree-structured, explicit memory manipulation, C calls, etc)
|
| perform instruction selection,
| sequentialization into basic blocks,
| assignment of pseudo-registers
|
v
Mach (block structured IR)
|
| liveness, register allocation, dead code elimination
| are Mach -> Mach transformations
|
v
Linear (linear sequence of abstract assembly instructions, explicit register assignments)
|
| this step is heavily backend-dependent, implemented in `emit.mlp`
|
v
Textual assembly code