package ocaml-base-compiler

  1. Overview
  2. Docs

Exported information (that is to say, information written into a .cmx file) about a compilation unit.

type value_string_contents =
  1. | Contents of string
  2. | Unknown_or_mutable
type value_string = {
  1. contents : value_string_contents;
  2. size : int;
}
type value_float_array_contents =
  1. | Contents of float option array
  2. | Unknown_or_mutable
type value_float_array = {
  1. contents : value_float_array_contents;
  2. size : int;
}
type descr =
  1. | Value_block of Tag.t * approx array
  2. | Value_mutable_block of Tag.t * int
  3. | Value_int of int
  4. | Value_char of char
  5. | Value_constptr of int
  6. | Value_float of float
  7. | Value_float_array of value_float_array
  8. | Value_boxed_int : 'a Simple_value_approx.boxed_int * 'a -> descr
  9. | Value_string of value_string
  10. | Value_closure of value_closure
  11. | Value_set_of_closures of value_set_of_closures
and value_closure = {
  1. closure_id : Closure_id.t;
  2. set_of_closures : value_set_of_closures;
}
and value_set_of_closures = {
  1. set_of_closures_id : Set_of_closures_id.t;
  2. bound_vars : approx Var_within_closure.Map.t;
  3. results : approx Closure_id.Map.t;
  4. aliased_symbol : Symbol.t option;
}
and approx =
  1. | Value_unknown
  2. | Value_id of Export_id.t
  3. | Value_symbol of Symbol.t
type t = private {
  1. sets_of_closures : Flambda.function_declarations Set_of_closures_id.Map.t;
    (*

    Code of exported functions indexed by set of closures IDs.

    *)
  2. closures : Flambda.function_declarations Closure_id.Map.t;
    (*

    Code of exported functions indexed by closure IDs.

    *)
  3. values : descr Export_id.Map.t Compilation_unit.Map.t;
    (*

    Structure of exported values.

    *)
  4. symbol_id : Export_id.t Symbol.Map.t;
    (*

    Associates symbols and values.

    *)
  5. offset_fun : int Closure_id.Map.t;
    (*

    Positions of function pointers in their closures.

    *)
  6. offset_fv : int Var_within_closure.Map.t;
    (*

    Positions of value pointers in their closures.

    *)
  7. constant_sets_of_closures : Set_of_closures_id.Set.t;
  8. invariant_params : Variable.Set.t Variable.Map.t Set_of_closures_id.Map.t;
}

A structure that describes what a single compilation unit exports.

val empty : t

Export information for a compilation unit that exports nothing.

Create a new export information structure.

val add_clambda_info : t -> offset_fun:int Closure_id.Map.t -> offset_fv:int Var_within_closure.Map.t -> constant_sets_of_closures:Set_of_closures_id.Set.t -> t

Record information about the layout of closures and which sets of closures are constant. These are all worked out during the Flambda_to_clambda pass.

val merge : t -> t -> t

Union of export information. Verifies that there are no identifier clashes.

val find_description : t -> Export_id.t -> descr

Look up the description of an exported value given its export ID.

Partition a mapping from export IDs by compilation unit.