From 6ae225dd621c0dfc099492847b9edcaf8e5342cf Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Sun, 27 Mar 2016 15:09:36 -0700 Subject: [PATCH] Merge captured targets after parsing args Summary:public To ensure that e.g. Config.results_dir is not used before being set. Reviewed By: cristianoc Differential Revision: D3102724 fb-gh-sync-id: ced0974 fbshipit-source-id: ced0974 --- infer/src/backend/config.ml | 3 +++ infer/src/backend/inferanalyze.ml | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/infer/src/backend/config.ml b/infer/src/backend/config.ml index a3c9d8a3c..9edf59031 100644 --- a/infer/src/backend/config.ml +++ b/infer/src/backend/config.ml @@ -199,6 +199,9 @@ let reactive_mode = ref false If a procedure was changed beforehand, keep the changed marking. *) let continue_capture = ref false +(** Merge the captured results directories specified in the dependency file *) +let merge = ref false + (** Flag for footprint discovery mode *) let footprint = ref true diff --git a/infer/src/backend/inferanalyze.ml b/infer/src/backend/inferanalyze.ml index 4862ddb76..6399ae0bb 100644 --- a/infer/src/backend/inferanalyze.ml +++ b/infer/src/backend/inferanalyze.ml @@ -165,7 +165,7 @@ let arg_desc = " activate the eradicate checker for java annotations" ; "-merge", - Arg.Unit MergeCapture.merge_captured_targets, + Arg.Set Config.merge, None, "merge the captured results directories specified in the dependency file" ; @@ -238,7 +238,8 @@ let () = (* parse command-line arguments *) begin L.err "ERROR: results directory %s does not exist@.@." !Config.results_dir; print_usage_exit () - end + end ; + if !Config.merge then MergeCapture.merge_captured_targets () let analyze_exe_env exe_env = let init_time = Unix.gettimeofday () in