jon.recoil.org

Module Flambda.Named

type t = named

The defining expressions of Let bindings.

include Expr_std.S with type 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 create_simple : Flambda2_term_basics.Simple.t -> t

Convert a register-width value into the defining expression of a Let.

Like create_simple but for variables.

val create_prim : Flambda_primitive.t -> Debuginfo.t -> t

Convert a primitive, with associated debugging information, into the defining expression of a Let.

val create_set_of_closures : Set_of_closures.t -> t

Convert a set of closures into the defining expression of a Let.

val create_static_consts : static_const_group -> t

Convert one or more statically-allocated constants into the defining expression of a Let.

val create_rec_info : Flambda2_term_basics.Rec_info_expr.t -> t

Convert one or more expressions for recursion state into the defining expression of a Let.

val dummy_value : machine_width:Target_system.Machine_width.t -> Flambda2_kinds.Flambda_kind.t -> t

Return a defining expression for a Let which is kind-correct, but not necessarily type-correct, at the given kind.

Return the kind of the expression. Must only be used on expressions bound to a singleton pattern (everything except sets of closures and static consts).

val is_dynamically_allocated_set_of_closures : t -> bool

Returns true iff the given expression is a set of closures that will be allocated on the OCaml heap during execution (i.e. not a statically-allocated set of closures).

val is_static_consts : t -> bool

Returns true iff the given expression is one or more statically-allocated constants.

val must_be_static_consts : t -> static_const_group
val at_most_generative_effects : t -> bool
val fold_code_and_sets_of_closures : t -> init:'a -> f_code:('a -> function_params_and_body Code0.t -> 'a) -> f_set:('a -> Set_of_closures.t -> 'a) -> 'a