[reactive] keep specs around in reactive mode

Reviewed By: mbouaziz

Differential Revision: D6358676

fbshipit-source-id: e41b94d
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent a73162d8e4
commit 82c9201bfc

@ -136,7 +136,9 @@ let main ~changed_files ~makefile =
| Some fname -> | Some fname ->
process_cluster_cmdline fname process_cluster_cmdline fname
| None -> | None ->
if Config.allow_specs_cleanup then DB.Results_dir.clean_specs_dir () ; (* delete all specs when doing a full analysis so that we do not report on procedures that do
not exist anymore *)
if not Config.reactive_mode then DB.Results_dir.clean_specs_dir () ;
let all_clusters = DB.find_source_dirs () in let all_clusters = DB.find_source_dirs () in
let clusters_to_analyze = let clusters_to_analyze =
List.filter ~f:(cluster_should_be_analyzed ~changed_files) all_clusters List.filter ~f:(cluster_should_be_analyzed ~changed_files) all_clusters

@ -597,11 +597,6 @@ and allow_leak =
CLOpt.mk_bool ~deprecated:["leak"] ~long:"allow-leak" "Forget leaked memory during abstraction" CLOpt.mk_bool ~deprecated:["leak"] ~long:"allow-leak" "Forget leaked memory during abstraction"
and allow_specs_cleanup =
CLOpt.mk_bool ~deprecated:["allow_specs_cleanup"] ~long:"allow-specs-cleanup" ~default:true
"Allow to remove existing specs before running analysis when it's not incremental"
and ( analysis_blacklist_files_containing_options and ( analysis_blacklist_files_containing_options
, analysis_path_regex_blacklist_options , analysis_path_regex_blacklist_options
, analysis_path_regex_whitelist_options , analysis_path_regex_whitelist_options
@ -2264,8 +2259,6 @@ and abs_struct = !abs_struct
and abs_val_orig = !abs_val and abs_val_orig = !abs_val
and allow_specs_cleanup = !allow_specs_cleanup
and analysis_path_regex_whitelist_options = and analysis_path_regex_whitelist_options =
List.map ~f:(fun (a, b) -> (a, !b)) analysis_path_regex_whitelist_options List.map ~f:(fun (a, b) -> (a, !b)) analysis_path_regex_whitelist_options

@ -282,8 +282,6 @@ val rest : string list
val abs_struct : int val abs_struct : int
val allow_specs_cleanup : bool
val analysis_path_regex_whitelist : analyzer -> string list val analysis_path_regex_whitelist : analyzer -> string list
val analysis_path_regex_blacklist : analyzer -> string list val analysis_path_regex_blacklist : analyzer -> string list

@ -240,10 +240,10 @@ module Results_dir = struct
let clean_specs_dir () = let clean_specs_dir () =
Utils.create_dir specs_dir ;
(* create dir just in case it doesn't exist to avoid errors *) (* create dir just in case it doesn't exist to avoid errors *)
let files_to_remove = Array.map ~f:(Filename.concat specs_dir) (Sys.readdir specs_dir) in Utils.create_dir specs_dir ;
Array.iter ~f:Sys.remove files_to_remove Array.iter (Sys.readdir specs_dir) ~f:(fun specs ->
Filename.concat specs_dir specs |> Sys.remove )
(** create a file at the given path, creating any missing directories *) (** create a file at the given path, creating any missing directories *)

Loading…
Cancel
Save