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 | 8d744a73b55b545f704906966e86cb28ede2423c (patch) | |
tree | c78f99442d865b08bf9c85fdf140a3da27ea5ee1 /lib/Frontend/CompilerInvocation.cpp | |
parent | 7482cce8b874cc5b3b44720f7e9fcd34e98f38d4 (diff) | |
download | clang-8d744a73b55b545f704906966e86cb28ede2423c.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 3c0fc391ea..9d5987f07f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/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, |