package ocaml-solo5-cross-aarch64

  1. Overview
  2. Docs
OCaml cross-compiler to the freestanding 64-bit ARM Solo5 backend

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.1.0.tar.gz
md5=00e5f51d0ce72f7517f3b2a7f910c572
sha512=91f349384a8864076c3d1b0ce3f4e94aa54900cf51e2471d21427bb25cbffac606bcd754fa545f4b2c4516ea2b0731cb580ab30bdf1911c9e47ee24d7c88c863

doc/compiler-libs.optcomp/Closure_conversion/index.html

Module Closure_conversion

val lambda_to_flambda : backend:(module Backend_intf.S) -> module_ident:Ident.t -> size:int -> Lambda.lambda -> Flambda.program

Generation of Flambda intermediate language code from Lambda code by performing a form of closure conversion.

Function declarations (which may bind one or more variables identifying functions, possibly with mutual recursion) are transformed to Set_of_closures expressions. Project_closure expressions are then used to select a closure for a particular function from a Set_of_closures expression. The Set_of_closures expressions say nothing about the actual runtime layout of the closures; this is handled when Flambda code is translated to Clambda code.

The following transformations are also performed during closure conversion:

  • Constant blocks (by which is meant things wrapped in Lambda.Const_block) are converted to applications of the Pmakeblock primitive.
  • Levent debugging event nodes are removed and the information within them attached to function, method and raise calls.
  • Tuplified functions are converted to curried functions and a stub function emitted to call the curried version. For example: let rec f (x, y) = f (x + 1, y + 1) is transformed to: let rec internal_f x y = f (x + 1,y + 1) and f (x, y) = internal_f x y (* f is marked as a stub function *)
  • The Pdirapply and Prevapply application primitives are removed and converted to normal Flambda application nodes.

The lambda_to_flambda function is not re-entrant.