Module InferModules__Callbacks

Module to register and invoke callbacks

type proc_callback_args = {
get_procs_in_file : InferIR.Typ.Procname.t -> InferIR.Typ.Procname.t list;
summary : InferModules.Summary.t;
exe_env : InferModules.Exe_env.t;
}
type proc_callback_t = proc_callback_args -> InferModules.Summary.t

Type of a procedure callback:

  • List of all the procedures the callback will be called on.
  • get_proc_desc to get a proc desc from a proc name
  • Type environment.
  • Procedure for the callback to act on.
type cluster_callback_args = {
procedures : (InferIR.Tenv.t * InferModules.Summary.t) list;
source_file : InferBase.SourceFile.t;
exe_env : InferModules.Exe_env.t;
}
type cluster_callback_t = cluster_callback_args -> unit
val register_procedure_callback : name:string -> ?⁠dynamic_dispatch:bool -> InferBase.Language.t -> proc_callback_t -> unit

register a procedure callback

val register_cluster_callback : name:string -> InferBase.Language.t -> cluster_callback_t -> unit

register a cluster callback

val iterate_procedure_callbacks : InferModules.Exe_env.t -> InferModules.Summary.t -> InferModules.Summary.t

Invoke all registered procedure callbacks on the given procedure.

val iterate_cluster_callbacks : InferIR.Typ.Procname.t InferStdlib.IStd.sexp_list -> InferModules.Exe_env.t -> InferBase.SourceFile.t -> unit

Invoke all registered cluster callbacks on a cluster of procedures.