From 8d744a73b55b545f704906966e86cb28ede2423c Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Mon, 14 Oct 2019 20:15:01 +0000 Subject: [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 --- lib/Frontend/CompilerInvocation.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Frontend/CompilerInvocation.cpp') 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, -- cgit v1.2.1