[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) (iterate_cluster_callbacks originally_defined_procs exe_env)
(cluster procs_to_analyze); (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 let tenv = Exe_env.get_tenv ~create:true exe_env proc_name in
store_summary tenv proc_name store_summary tenv proc_name)
) procs_to_analyze; procs_to_analyze;
Config.curr_language := saved_language Config.curr_language := saved_language

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

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

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

Loading…
Cancel
Save