[ondemand] only look at capture DB for attributes

Summary:
Ondemand looks at the attributes in the summary of a function in preference to those in the capture DB, in order to decide whether a function needs to be analysed. This is unnecessary and introduces non-determinism (whether the summary has been written is a race condition; attributes may differ from a pre-analysed CFG vs captured).

Switch to only looking at the attributes column in the capture DB.

Reviewed By: da319

Differential Revision: D29932634

fbshipit-source-id: 8d7d1b145
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent 389907f4da
commit 6a6d888419

@ -268,16 +268,6 @@ module OnDisk = struct
else Option.map (get model_name) ~f:(fun (s : full_summary) -> s.proc_desc)
(** Try to find the attributes for a defined proc. First look at specs (to get attributes computed
by analysis) then look at the attributes table. If no attributes can be found, return None. *)
let proc_resolve_attributes proc_name =
match get proc_name with
| Some summary ->
Some (get_attributes summary)
| None ->
Attributes.load proc_name
(** Save summary for the procedure into the spec database *)
let store (summary : t) =
let proc_name = get_proc_name summary in

@ -70,10 +70,6 @@ module OnDisk : sig
val reset : Procdesc.t -> t
(** Reset a summary rebuilding the dependents and preserving the proc attributes if present. *)
val proc_resolve_attributes : Procname.t -> ProcAttributes.t option
(** Try to find the attributes for a defined proc. First look at specs (to get attributes computed
by analysis) then look at the attributes table. If no attributes can be found, return None. *)
val store_analyzed : t -> unit
(** Save summary for the procedure into the spec database *)

@ -68,10 +68,8 @@ let should_be_analyzed proc_attributes =
(not (is_active proc_name)) (* avoid infinite loops *) && not (already_analyzed proc_name)
let get_proc_attr proc_name = Summary.OnDisk.proc_resolve_attributes proc_name
let procedure_should_be_analyzed proc_name =
match get_proc_attr proc_name with
match Attributes.load proc_name with
| Some proc_attributes ->
should_be_analyzed proc_attributes
| None ->

Loading…
Cancel
Save