jon.recoil.org

Module Flambda2_terms.Code

A piece of code, comprising of the parameters and body of a function, together with a field indicating whether the piece of code is a newer version of one that existed previously (and may still exist), for example after a round of simplification.

val code_metadata : t -> Code_metadata.t
val params_and_body : t -> Flambda.Function_params_and_body.t
include Code_metadata.Code_metadata_accessors_result_type with type 'a t := t
val newer_version_of : t -> Flambda2_identifiers.Code_id.t option
val params_arity : t -> [ `Complex ] Flambda2_kinds.Flambda_arity.t
val first_complex_local_param : t -> int
val result_arity : t -> [ `Unarized ] Flambda2_kinds.Flambda_arity.t
val result_mode : t -> Lambda.locality_mode
val stub : t -> bool
val inline : t -> Inline_attribute.t
val zero_alloc_attribute : t -> Zero_alloc_attribute.t
val poll_attribute : t -> Poll_attribute.t
val regalloc_attribute : t -> Regalloc_attribute.t
val regalloc_param_attribute : t -> Regalloc_param_attribute.t
val cold : t -> bool
val is_a_functor : t -> bool
val is_opaque : t -> bool
val recursive : t -> Recursive.t
val cost_metrics : t -> Cost_metrics.t
val inlining_arguments : t -> Inlining_arguments.t
val dbg : t -> Debuginfo.t
val is_tupled : t -> bool
val is_my_closure_used : t -> bool
val inlining_decision : t -> Function_decl_inlining_decision_type.t
val absolute_history : t -> Inlining_history.Absolute.t
val relative_history : t -> Inlining_history.Relative.t
val loopify : t -> Loopify_attribute.t
val function_slot_size : t -> int
val create_with_metadata : params_and_body:Flambda.Function_params_and_body.t -> free_names_of_params_and_body:Flambda2_nominal.Name_occurrences.t -> code_metadata:Code_metadata.t -> t
val create : params_and_body:Flambda.Function_params_and_body.t -> free_names_of_params_and_body:Flambda2_nominal.Name_occurrences.t -> t Code_metadata.create_type
val with_code_id : Flambda2_identifiers.Code_id.t -> t -> t
val with_params_and_body : params_and_body:Flambda.Function_params_and_body.t -> free_names_of_params_and_body:Flambda2_nominal.Name_occurrences.t -> cost_metrics:Cost_metrics.t -> t -> t
val with_newer_version_of : Flambda2_identifiers.Code_id.t option -> t -> t
val print : Format.formatter -> t -> unit
include Flambda2_nominal.Contains_names.S with type t := t

Compute the free names of a term. Such computation covers all kinds of bindable names (variables, continuations, ...)

val apply_renaming : t -> Flambda2_nominal.Renaming.t -> t

Apply a renaming throughout a term.

val ids_for_export : t -> Flambda2_nominal.Ids_for_export.t
val map_result_types : t -> f:(Flambda2_types.t -> Flambda2_types.t) -> t
val free_names_of_params_and_body : t -> Flambda2_nominal.Name_occurrences.t