jon.recoil.org

Module Flambda2_terms.Switch_expr

Representation of conditional control flow: the Switch expression.

Scrutinees of Switches are of kind Naked_immediate. There are no default cases. Switches always have at least two cases.

type t
include Flambda2_terms.Expr_std.S with type t := Flambda2_terms.Switch_expr.t
include Flambda2_nominal.Contains_names.S with type t := Flambda2_terms.Switch_expr.t

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

Apply a renaming throughout a term.

include Flambda2_nominal.Contains_ids.S with type t := Flambda2_terms.Switch_expr.t

Gather all table identifiers to export them.

Create a Switch corresponding to a traditional if-then-else.

The scrutinee of the switch.

The debuginfo to be used for the condition.

Call the given function f on each (discriminant, action) pair in the switch.

What the switch will do for each possible value of the discriminant.

val num_arms : Flambda2_terms.Switch_expr.t -> int

How many cases the switch has. (Note that this is not the number of destinations reached by the switch, which may be a smaller number.)