From d3a36947bdaca80570b25e6686b5c579778d8f39 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 8 Aug 2018 03:28:08 -0700 Subject: [PATCH] [specs] do not expose specs cache Summary: Exposing the in-memory cache seems dangerous. There were only 2 uses anyway: eradicate and biabduction. I think the biabduction one is safe to remove. The eradicate one I do not really understand as we return a different summary than the one we cache... the tests pass though. Reviewed By: jeremydubreil Differential Revision: D9150167 fbshipit-source-id: cf30af232 --- infer/src/backend/Summary.mli | 3 --- infer/src/biabduction/interproc.ml | 1 - infer/src/eradicate/eradicate.ml | 16 +--------------- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/infer/src/backend/Summary.mli b/infer/src/backend/Summary.mli index de5af586c..01adaa73f 100644 --- a/infer/src/backend/Summary.mli +++ b/infer/src/backend/Summary.mli @@ -54,9 +54,6 @@ type t = val dummy : t (** dummy summary for testing *) -val add : Typ.Procname.t -> t -> unit -(** Add the summary to the table for the given function *) - val has_model : Typ.Procname.t -> bool (** Check if a summary for a given procedure exists in the models directory *) diff --git a/infer/src/biabduction/interproc.ml b/infer/src/biabduction/interproc.ml index 937cca20f..305f8a0e6 100644 --- a/infer/src/biabduction/interproc.ml +++ b/infer/src/biabduction/interproc.ml @@ -1245,7 +1245,6 @@ let analyze_procedure_aux summary exe_env tenv proc_desc : Summary.t = | _ -> summaryre in - Summary.add proc_name summary_compact ; summary_compact diff --git a/infer/src/eradicate/eradicate.ml b/infer/src/eradicate/eradicate.ml index 3cbd673d4..d3be8ce5c 100644 --- a/infer/src/eradicate/eradicate.ml +++ b/infer/src/eradicate/eradicate.ml @@ -36,20 +36,6 @@ end (** Create a module with the toplevel callback. *) module MkCallback (Extension : ExtensionT) : CallBackT = struct - (** Update the summary with stats from the checker. *) - let update_summary proc_name final_typestate_opt = - match Summary.get proc_name with - | Some old_summ -> - let new_summ = - { old_summ with - Summary.payloads= - Extension.update_payloads final_typestate_opt old_summ.Summary.payloads } - in - Summary.add proc_name new_summ - | None -> - () - - let callback1 tenv find_canonical_duplicate calls_this checks get_proc_desc idenv curr_pname curr_pdesc annotated_signature linereader proc_loc : bool * Extension.extension TypeState.t option = @@ -321,7 +307,7 @@ module MkCallback (Extension : ExtensionT) : CallBackT = struct EradicateChecks.check_overridden_annotations find_canonical_duplicate tenv curr_pname curr_pdesc annotated_signature ; TypeErr.report_forall_checks_and_reset tenv (Checkers.ST.report_error tenv) curr_pdesc ; - update_summary curr_pname final_typestate_opt + () (** Entry point for the eradicate-based checker infrastructure. *)