jon.recoil.org

Module Flambda.Continuation_handler

type t

The alpha-equivalence class of the binding of a list of parameters around an expression, forming a continuation handler, together with auxiliary information about such handler.

val print : cont:Flambda2_identifiers.Continuation.t -> recursive:Recursive.t -> Format.formatter -> t -> unit
val apply_renaming : t -> Flambda2_nominal.Renaming.t -> t
val create : Flambda2_bound_identifiers.Bound_parameters.t -> handler:expr -> free_names_of_handler: Flambda2_nominal.Name_occurrences.t Flambda2_lattices.Or_unknown.t -> is_exn_handler:bool -> is_cold:bool -> t

Create the representation of a single continuation handler.

val pattern_match' : t -> f: (Flambda2_bound_identifiers.Bound_parameters.t -> num_normal_occurrences_of_params: Flambda2_nominal.Num_occurrences.t Flambda2_identifiers.Variable.Map.t -> handler:expr -> 'a) -> 'a

Choose a member of the alpha-equivalence class to enable examination of the parameters and the code over which they are scoped.

val pattern_match : t -> f:(Flambda2_bound_identifiers.Bound_parameters.t -> handler:expr -> 'a) -> 'a
module Pattern_match_pair_error : sig ... end
val pattern_match_pair : t -> t -> f: (Flambda2_bound_identifiers.Bound_parameters.t -> handler1:expr -> handler2:expr -> 'a) -> ('a, Pattern_match_pair_error.t) Result.t

Choose members of two bindings' alpha-equivalence classes using the same parameters.

val is_exn_handler : t -> bool

Whether the continuation is an exception handler.

Continuations used as exception handlers are always Non_recursive. To enable identification of them in passes not invoked from Simplify (where they could be identified by looking at the Apply_conts that reference them) they are marked explicitly.

Continuations used as exception handlers may have more than one parameter (see Exn_continuation).

(Relevant piece of background info: the backend cannot compile simultaneously-defined continuations when one or more of them is an exception handler.)

val is_cold : t -> bool