diff options
author | Jan Korous <jkorous@apple.com> | 2019-10-14 20:15:01 +0000 |
---|---|---|
committer | Jan Korous <jkorous@apple.com> | 2019-10-14 20:15:01 +0000 |
commit | c5d14b5c6fa9e003ef2037dcd3601c8339b1e42f (patch) | |
tree | a57626e41231766bbe747d3df24cb04f6928e7bd /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7e385bd2f526cc04b4a7cc6af1f39744f304d31a (diff) | |
download | llvm-c5d14b5c6fa9e003ef2037dcd3601c8339b1e42f.zip llvm-c5d14b5c6fa9e003ef2037dcd3601c8339b1e42f.tar.gz llvm-c5d14b5c6fa9e003ef2037dcd3601c8339b1e42f.tar.bz2 |
[clang-scan-deps] Support for clang --analyze in clang-scan-deps
The goal is to have 100% fidelity in clang-scan-deps behavior when
--analyze is present in compilation command.
At the same time I don't want to break clang-tidy which expects
__static_analyzer__ macro defined as built-in.
I introduce new cc1 options (-setup-static-analyzer) that controls
the macro definition and is conditionally set in driver.
Differential Revision: https://reviews.llvm.org/D68093
llvm-svn: 374815
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 3c0fc39..9d5987f 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3349,6 +3349,8 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, // "editor placeholder in source file" error in PP only mode. if (isStrictlyPreprocessorAction(Action)) Opts.LexEditorPlaceholders = false; + + Opts.SetUpStaticAnalyzer = Args.hasArg(OPT_setup_static_analyzer); } static void ParsePreprocessorOutputArgs(PreprocessorOutputOptions &Opts, |