@ -15,7 +15,7 @@ type proc_callback_args =
type proc_callback_t = proc_callback_args -> Summary . t
type proc_callback_t = proc_callback_args -> Summary . t
type cluster_callback_args =
type cluster_callback_args =
{ procedures : Summary . t list ; source_file : SourceFile . t ; exe_env : Exe_env . t }
{ procedures : Procname . t list ; source_file : SourceFile . t ; exe_env : Exe_env . t }
type cluster_callback_t = cluster_callback_args -> unit
type cluster_callback_t = cluster_callback_args -> unit
@ -37,10 +37,6 @@ let register_cluster_callback ~name language (callback : cluster_callback_t) =
cluster_callbacks := { name ; language ; callback } :: ! cluster_callbacks
cluster_callbacks := { name ; language ; callback } :: ! cluster_callbacks
let get_procedure_definition proc_name =
Procdesc . load proc_name | > Option . map ~ f : Summary . OnDisk . reset
(* * Invoke all registered procedure callbacks on the given procedure. *)
(* * Invoke all registered procedure callbacks on the given procedure. *)
let iterate_procedure_callbacks exe_env summary =
let iterate_procedure_callbacks exe_env summary =
let proc_desc = Summary . get_proc_desc summary in
let proc_desc = Summary . get_proc_desc summary in
@ -74,14 +70,13 @@ let iterate_procedure_callbacks exe_env summary =
(* * Invoke all registered cluster callbacks on a cluster of procedures. *)
(* * Invoke all registered cluster callbacks on a cluster of procedures. *)
let iterate_cluster_callbacks all_ procs exe_env source_file =
let iterate_cluster_callbacks procedure s exe_env source_file =
if ! cluster_callbacks < > [] then
if ! cluster_callbacks < > [] then
let procedures = List . filter_map ~ f : get_procedure_definition all_procs in
let environment = { procedures ; source_file ; exe_env } in
let environment = { procedures ; source_file ; exe_env } in
let language_matches language =
let language_matches language =
match procedures with
match procedures with
| summary :: _ ->
| procname :: _ ->
Language . equal language ( Procname . get_language ( Summary . get_ proc_ name summary ) )
Language . equal language ( Procname . get_language procname)
| _ ->
| _ ->
true
true
in
in