jon.recoil.org

Module Flambda2_terms.Apply_expr

The representation of the application of an OCaml function, OCaml method or external call to a list of arguments.

type t
val free_names_except_callee : t -> Flambda2_nominal.Name_occurrences.t
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 free_names_without_exn_continuation : t -> Flambda2_nominal.Name_occurrences.t
include Flambda2_nominal.Contains_ids.S with type t := t
val ids_for_export : t -> Flambda2_nominal.Ids_for_export.t

Gather all table identifiers to export them.

module Result_continuation : sig ... end
module Position : sig ... end
val create : callee:Flambda2_term_basics.Simple.t option -> continuation:Result_continuation.t -> Exn_continuation.t -> args:Flambda2_term_basics.Simple.t list -> args_arity:[ `Complex ] Flambda2_kinds.Flambda_arity.t -> return_arity:[ `Unarized ] Flambda2_kinds.Flambda_arity.t -> call_kind:Call_kind.t -> alloc_mode:Flambda2_bound_identifiers.Alloc_mode.For_applications.t -> Debuginfo.t -> inlined:Inlined_attribute.t -> inlining_state:Inlining_state.t -> probe:Probe.t -> position:Position.t -> relative_history:Inlining_history.Relative.t -> t

Create an application expression.

val callee : t -> Flambda2_term_basics.Simple.t option

The function or method being applied.

val args : t -> Flambda2_term_basics.Simple.t list

The arguments of the function or method being applied.

val args_arity : t -> [ `Complex ] Flambda2_kinds.Flambda_arity.t

The arity of the arguments being applied.

val return_arity : t -> [ `Unarized ] Flambda2_kinds.Flambda_arity.t

The arity of the result(s) of the application.

val call_kind : t -> Call_kind.t

Information about what kind of call is involved (direct function call, method call, etc).

val continuation : t -> Result_continuation.t

Where to send the result of the application.

val exn_continuation : t -> Exn_continuation.t

Where to jump to upon the application raising an exception.

val dbg : t -> Debuginfo.t

Debugging information attached to the application.

val inlined : t -> Inlined_attribute.t

Instructions from the source code as to whether the callee should be inlined.

val position : t -> Position.t

Whether the call was marked @nontail

val erase_callee : t -> t
val with_continuation : t -> Result_continuation.t -> t

Change the return continuation of an application.

val with_continuations : t -> Result_continuation.t -> Exn_continuation.t -> t
val with_exn_continuation : t -> Exn_continuation.t -> t
val with_args : t -> Flambda2_term_basics.Simple.t list -> args_arity:[ `Complex ] Flambda2_kinds.Flambda_arity.t -> t

Change the arguments of an application

val with_call_kind : t -> Call_kind.t -> t

Change the call kind of an application.

val inlining_state : t -> Inlining_state.t
val inlining_arguments : t -> Inlining_arguments.t
val probe : t -> Probe.t
val relative_history : t -> Inlining_history.Relative.t
val returns : t -> bool

Returns true if the application returns to the caller, false if it is non terminating.

val with_inlined_attribute : t -> Inlined_attribute.t -> t