[clang] only pass `--Xclang` args to driver commands

Summary:
Not all clang commands are happy with all arguments, but the driver is usually
the place we want to add arguments to.

Reviewed By: martinoluca

Differential Revision: D9421403

fbshipit-source-id: fa6d39a9b
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 76bf31bc17
commit a3d5f0283d

@ -190,7 +190,9 @@ let mk ~is_driver quoting_style ~prog ~args =
let sanitized_args = let sanitized_args =
filter_and_replace_unsupported_args ~blacklisted_flags:clang_blacklisted_flags filter_and_replace_unsupported_args ~blacklisted_flags:clang_blacklisted_flags
~blacklisted_flags_with_arg args ~blacklisted_flags_with_arg args
@ List.rev Config.clang_extra_flags in
let sanitized_args =
if is_driver then sanitized_args @ List.rev Config.clang_extra_flags else sanitized_args
in in
{exec= prog; orig_argv= sanitized_args; argv= sanitized_args; quoting_style; is_driver} {exec= prog; orig_argv= sanitized_args; argv= sanitized_args; quoting_style; is_driver}

@ -7,7 +7,7 @@ TESTS_DIR = ../..
ANALYZER = checkers ANALYZER = checkers
CLANG_OPTIONS = -c CLANG_OPTIONS = -c
INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze --Xclang -U --Xclang __SSE2__
INFERPRINT_OPTIONS = --issues-tests INFERPRINT_OPTIONS = --issues-tests
SOURCES = \ SOURCES = \

Loading…
Cancel
Save