package ocaml-base-compiler
Exported information (that is to say, information written into a .cmx file) about a compilation unit.
type descr =
| Value_block of Tag.t * approx array
| Value_mutable_block of Tag.t * int
| Value_int of int
| Value_char of char
| Value_constptr of int
| Value_float of float
| Value_float_array of value_float_array
| Value_boxed_int : 'a Simple_value_approx.boxed_int * 'a -> descr
| Value_string of value_string
| Value_closure of value_closure
| Value_set_of_closures of value_set_of_closures
and value_set_of_closures = {
set_of_closures_id : Set_of_closures_id.t;
bound_vars : approx Var_within_closure.Map.t;
results : approx Closure_id.Map.t;
aliased_symbol : Symbol.t option;
}
type t = private {
sets_of_closures : Flambda.function_declarations Set_of_closures_id.Map.t;
(*Code of exported functions indexed by set of closures IDs.
*)closures : Flambda.function_declarations Closure_id.Map.t;
(*Code of exported functions indexed by closure IDs.
*)values : descr Export_id.Map.t Compilation_unit.Map.t;
(*Structure of exported values.
*)symbol_id : Export_id.t Symbol.Map.t;
(*Associates symbols and values.
*)offset_fun : int Closure_id.Map.t;
(*Positions of function pointers in their closures.
*)offset_fv : int Var_within_closure.Map.t;
(*Positions of value pointers in their closures.
*)constant_sets_of_closures : Set_of_closures_id.Set.t;
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.
val create :
sets_of_closures:Flambda.function_declarations Set_of_closures_id.Map.t ->
closures:Flambda.function_declarations Closure_id.Map.t ->
values:descr Export_id.Map.t Compilation_unit.Map.t ->
symbol_id:Export_id.t Symbol.Map.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 ->
invariant_params:Variable.Set.t Variable.Map.t Set_of_closures_id.Map.t ->
t
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 find_description : t -> Export_id.t -> descr
Look up the description of an exported value given its export ID.
val nest_eid_map :
'a Export_id.Map.t ->
'a Export_id.Map.t Compilation_unit.Map.t
Partition a mapping from export IDs by compilation unit.