From 8f154144c05b92d45e3317d114e1ad05e49f0be3 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 20 May 2016 09:48:51 -0700 Subject: [PATCH] add skip_clang_analysis_in_path from inferconfig to the CLI Summary: Part of the migration of .inferconfig-specific options into options accepted both by .inferconfig and the CLI. Reviewed By: jberdine Differential Revision: D3322508 fbshipit-source-id: 1820a9d --- infer/src/backend/config.ml | 5 +++++ infer/src/backend/config.mli | 1 + infer/src/backend/inferconfig.ml | 3 --- infer/src/backend/inferconfig.mli | 2 -- infer/src/clang/cLocation.ml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/infer/src/backend/config.ml b/infer/src/backend/config.ml index 151036afe..6e7024f18 100644 --- a/infer/src/backend/config.ml +++ b/infer/src/backend/config.ml @@ -634,6 +634,10 @@ and seconds_per_iteration = CLOpt.mk_float ~deprecated:["seconds_per_iteration"] ~long:"seconds-per-iteration" ~default:0. ~meta:"float" "Set the number of seconds per iteration" +and skip_clang_analysis_in_path = + CLOpt.mk_string_list ~long:"skip-clang-analysis-in-path" + ~exes:CLOpt.[C] ~meta:"path prefix" "Ignore files whose path matches the given prefix" + and skip_translation_headers = CLOpt.mk_string_list ~deprecated:["skip_translation_headers"] ~long:"skip-translation-headers" ~meta:"path prefix" "Ignore headers whose path matches the given prefix" @@ -1079,6 +1083,7 @@ and save_analysis_results = !save_results and seconds_per_iteration = !seconds_per_iteration and show_buckets = !print_buckets and show_progress_bar = !progress_bar +and skip_clang_analysis_in_path = !skip_clang_analysis_in_path and skip_translation_headers = !skip_translation_headers and source_file = !source_file and source_file_copy = !source_file_copy diff --git a/infer/src/backend/config.mli b/infer/src/backend/config.mli index d4ac970b2..ba1ae8fbd 100644 --- a/infer/src/backend/config.mli +++ b/infer/src/backend/config.mli @@ -169,6 +169,7 @@ val save_analysis_results : string option val seconds_per_iteration : float val show_buckets : bool val show_progress_bar : bool +val skip_clang_analysis_in_path : string list val skip_translation_headers : string list val source_file : string option val source_file_copy : string option diff --git a/infer/src/backend/inferconfig.ml b/infer/src/backend/inferconfig.ml index 0b34b1f98..1f01c6391 100644 --- a/infer/src/backend/inferconfig.ml +++ b/infer/src/backend/inferconfig.ml @@ -406,6 +406,3 @@ let test () = (DB.source_file_to_rel_path source_file) matching_s) (Sys.getcwd ()) - -let skip_clang_analysis_in_path = - lazy (lookup_string_list "skip-clang-analysis-in-path" (Lazy.force Config.inferconfig_json)) diff --git a/infer/src/backend/inferconfig.mli b/infer/src/backend/inferconfig.mli index bf6a7f30f..3ed74021c 100644 --- a/infer/src/backend/inferconfig.mli +++ b/infer/src/backend/inferconfig.mli @@ -50,8 +50,6 @@ end (** Load the config file and list the files to report on *) val test: unit -> unit -val skip_clang_analysis_in_path : string list Lazy.t - (** is_checker_enabled [error_name] is [true] if [error_name] is whitelisted in .inferconfig or if it's enabled by default *) val is_checker_enabled : string -> bool diff --git a/infer/src/clang/cLocation.ml b/infer/src/clang/cLocation.ml index 3cfa89866..fbabc96ae 100644 --- a/infer/src/clang/cLocation.ml +++ b/infer/src/clang/cLocation.ml @@ -132,7 +132,7 @@ let should_translate_lib source_range decl_trans_context = || should_translate source_range decl_trans_context let is_file_blacklisted file = - let paths = Lazy.force Inferconfig.skip_clang_analysis_in_path in + let paths = Config.skip_clang_analysis_in_path in let is_file_blacklisted = IList.exists (fun path -> Str.string_match (Str.regexp ("^.*/" ^ path)) file 0)