jon.recoil.org

Module Flambda2_simplify.Continuation_uses_env

type t
val print : Format.formatter -> t -> unit
val empty : t
include Continuation_uses_env_intf.S with type t := t

We don't have an interface that insists on adding continuations before seeing their uses. This would be problematic when inserting wrappers, where we have already advanced past the point at which such wrappers would need to be defined, before knowing that a wrapper is needed.

val delete_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> t
val get_typing_env_no_more_than_one_use : t -> Flambda2_identifiers.Continuation.t -> Flambda2_types.Typing_env.t option
val num_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> int
val all_continuations_used : t -> Flambda2_identifiers.Continuation.Set.t
val get_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> Continuation_uses.t option
val clear_continuation_uses : t -> Flambda2_identifiers.Continuation.t -> t
val union : t -> t -> t
val mark_non_inlinable : t -> t

Manually add a continuation use, with everything specified, including the id for the apply_cont (contrary to record_continuation_uses which always generates a fresh id). Users of this function must take care to ensure there's only one use per id.