[infer][backend] More consistent API to check if a procedure is currently being analyzed

Summary: For some reason, `Specs.is_active` was re-loading from the specs table the summary that should already be in scope.

Reviewed By: cristianoc

Differential Revision: D4124693

fbshipit-source-id: c0e9113
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 5358646c6f
commit 9baea70548

@ -179,9 +179,10 @@ let iterate_callbacks store_summary call_graph exe_env =
(iterate_cluster_callbacks originally_defined_procs exe_env)
(cluster procs_to_analyze);
IList.iter (fun proc_name ->
IList.iter
(fun proc_name ->
let tenv = Exe_env.get_tenv ~create:true exe_env proc_name in
store_summary tenv proc_name
) procs_to_analyze;
store_summary tenv proc_name)
procs_to_analyze;
Config.curr_language := saved_language

@ -54,8 +54,9 @@ let nesting = ref 0
let should_be_analyzed proc_attributes proc_name =
let currently_analyzed () =
Specs.summary_exists proc_name &&
Specs.is_active proc_name in
match Specs.get_summary proc_name with
| None -> false
| Some summary -> Specs.is_active summary in
let already_analyzed () =
match Specs.get_summary proc_name with
| Some summary ->

@ -627,8 +627,7 @@ let get_summary proc_name =
let get_summary_unsafe s proc_name =
match get_summary proc_name with
| None ->
raise (Failure (
"[" ^ s ^ "] Specs.get_summary_unsafe: " ^ (Procname.to_string proc_name) ^ "Not_found"))
failwithf "[%s] Specs.get_summary_unsafe: %a Not found" s Procname.pp proc_name
| Some summary -> summary
(** Check if the procedure is from a library:
@ -689,11 +688,8 @@ let summary_exists proc_name =
let get_status summary =
summary.status
let is_active proc_name =
get_status (get_summary_unsafe "is_active" proc_name) = ACTIVE
let is_inactive proc_name =
get_status (get_summary_unsafe "is_active" proc_name) = INACTIVE
let is_active summary =
get_status summary = ACTIVE
let get_timestamp summary =
summary.timestamp

@ -205,10 +205,7 @@ val get_timestamp : summary -> int
val get_status : summary -> status
(** Check if the procedure is active *)
val is_active : Procname.t -> bool
(** Check if the procedure is active *)
val is_inactive : Procname.t -> bool
val is_active : summary -> bool
(** Initialize the summary for [proc_name] given dependent procs in list [depend_list].
Do nothing if a summary exists already. *)

Loading…
Cancel
Save