jon.recoil.org

Module Flow.Acc

type t

The type of accumulator for flow analysis

val print : Format.formatter -> t -> unit

printing

val empty : unit -> t

Empty uses

Initialize the analysis so that the stack consists of a single toplevel continuation.

val enter_continuation : Flambda2_identifiers.Continuation.t -> recursive:bool -> is_exn_handler:bool -> Flambda2_bound_identifiers.Bound_parameters.t -> t -> t

Add a new continuation on the stack. Used when entering a continuation handler.

val exit_continuation : Flambda2_identifiers.Continuation.t -> t -> t

Pop the current top of the stack. Used when exiting the current continuation handler.

val record_lifted_constants : Lifted_constant_state.t -> t -> t

Record that the current expression defines some lifted constants; this is not liked to the current continuation. Note: this should only be called at top-level, where the constants will be placed, and not from the fonction where the constants come from.

val record_defined_var : Flambda2_identifiers.Variable.t -> t -> t

That variable is defined in the current handler

val record_var_binding : Flambda2_identifiers.Variable.t -> Flambda2_nominal.Name_occurrences.t -> generate_phantom_lets:bool -> t -> t

Add a variable binding from the current handler.

val record_let_binding : rewrite_id:Flambda2_identifiers.Named_rewrite_id.t -> generate_phantom_lets:bool -> let_bound:Flambda2_bound_identifiers.Bound_pattern.t -> simplified_defining_expr:Simplified_named.t -> t -> t

Record a let-binding

Add a variable binding to the symbol. Projections might get recorded multiple times.

Add a symbol binding from the current handler.

Add a code id binding from the current handler.

Add a value slot from the current handler.

val add_used_in_current_handler : Flambda2_nominal.Name_occurrences.t -> t -> t

Add name occurrences used in the body of the current continuation's handler, *excluding* uses in apply_cont expressions, which are tracked separately.

Add the given continuation as being used as the return continuation for a function call.

Add, for the current continuation handler, uses for an apply cont of the given continuation with given arguments occurrences.

Add extra params and args to a continuation.