diff --git a/infer/man/man1/infer-capture.txt b/infer/man/man1/infer-capture.txt index b7fa34c29..8faa80528 100644 --- a/infer/man/man1/infer-capture.txt +++ b/infer/man/man1/infer-capture.txt @@ -263,6 +263,10 @@ CLANG OPTIONS --headers Activates: Analyze code in header files (Conversely: --no-headers) + --skip-non-capture-clang-commands + Activates: Skip clang commands that Infer doesn't use to capture + data (Conversely: --no-skip-non-capture-clang-commands) + --skip-translation-headers +path_prefix Ignore headers whose path matches the given prefix diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index d8995269f..181c90908 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -1137,6 +1137,11 @@ OPTIONS computing differential reports (Conversely: --skip-duplicated-types) See also infer-reportdiff(1). + --skip-non-capture-clang-commands + Activates: Skip clang commands that Infer doesn't use to capture + data (Conversely: --no-skip-non-capture-clang-commands) + See also infer-capture(1). + --skip-translation-headers +path_prefix Ignore headers whose path matches the given prefix See also infer-capture(1). diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index 19477edef..1e4f99bad 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -1137,6 +1137,11 @@ OPTIONS computing differential reports (Conversely: --skip-duplicated-types) See also infer-reportdiff(1). + --skip-non-capture-clang-commands + Activates: Skip clang commands that Infer doesn't use to capture + data (Conversely: --no-skip-non-capture-clang-commands) + See also infer-capture(1). + --skip-translation-headers +path_prefix Ignore headers whose path matches the given prefix See also infer-capture(1). diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index f029ec892..9e06c3701 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -2169,6 +2169,12 @@ and skip_duplicated_types = "Skip fixed-then-introduced duplicated types while computing differential reports" +and skip_non_capture_clang_commands = + CLOpt.mk_bool ~long:"skip-non-capture-clang-commands" + ~in_help:InferCommand.[(Capture, manual_clang)] + ~default:false "Skip clang commands that Infer doesn't use to capture data" + + and skip_translation_headers = CLOpt.mk_string_list ~deprecated:["skip_translation_headers"] ~long:"skip-translation-headers" ~in_help:InferCommand.[(Capture, manual_clang)] @@ -3254,6 +3260,8 @@ and skip_analysis_in_path_skips_compilation = !skip_analysis_in_path_skips_compi and skip_duplicated_types = !skip_duplicated_types +and skip_non_capture_clang_commands = !skip_non_capture_clang_commands + and skip_translation_headers = RevList.to_list !skip_translation_headers and source_preview = !source_preview diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 17d4ae328..50748c978 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -561,6 +561,8 @@ val skip_analysis_in_path_skips_compilation : bool val skip_duplicated_types : bool +val skip_non_capture_clang_commands : bool + val skip_translation_headers : string list val source_files : bool diff --git a/infer/src/clang/ClangWrapper.ml b/infer/src/clang/ClangWrapper.ml index c6332c1ff..1d7eabf92 100644 --- a/infer/src/clang/ClangWrapper.ml +++ b/infer/src/clang/ClangWrapper.ml @@ -151,7 +151,7 @@ let exec_action_item ~prog ~args = function Capture.capture clang_cmd | DriverCommand clang_cmd -> if - Config.skip_analysis_in_path_skips_compilation + (not Config.skip_non_capture_clang_commands) || Option.exists Config.buck_mode ~f:BuckMode.is_clang_compilation_db then Capture.run_clang clang_cmd Utils.echo_in else