[clang] add a new flag --skip-non-capture-clang-commands to makes clangdriver skip compilation on commands that doesn't capture data

Summary:
ClangWrapper.ml was skipping clang commands that didn't capture
by default. It was using the 'skip_analysis_in_path_skips_compilation'
flag to NOT skip commands. This is a confusing use of that flag.

Default should be to run clang (in case it does something useful),
and a new flag to disable this.

Reviewed By: ngorogiannis

Differential Revision: D26459100

fbshipit-source-id: 7f2e9a269
master
Martin Trojer 4 years ago committed by Facebook GitHub Bot
parent 7af9d02542
commit 7fcb9446dd

@ -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

@ -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).

@ -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).

@ -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

@ -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

@ -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

Loading…
Cancel
Save