summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2019-09-24 00:33:47 +0000
committerJan Korous <jkorous@apple.com>2019-09-24 00:33:47 +0000
commitfbd13570b0d5f92ef2cf6bcfe7cc2f6178500187 (patch)
tree7b92759b8a8157d032135c2bc344e320f3a4d109 /clang/lib/Driver/ToolChains
parenta4dd98f2e90b2916fd347020c70ba804c5557db1 (diff)
downloadbcm5719-llvm-fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187.tar.gz
bcm5719-llvm-fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187.zip
[static analyzer] Define __clang_analyzer__ macro in driver
Differential Revision: https://reviews.llvm.org/D67938 llvm-svn: 372679
Diffstat (limited to 'clang/lib/Driver/ToolChains')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index aa17efbee32..6453af73b0a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3896,8 +3896,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_municode))
CmdArgs.push_back("-DUNICODE");
- if (isa<AnalyzeJobAction>(JA))
+ if (isa<AnalyzeJobAction>(JA)) {
RenderAnalyzerOptions(Args, CmdArgs, Triple, Input);
+ CmdArgs.push_back("-D__clang_analyzer__");
+ }
// Enable compatilibily mode to avoid analyzer-config related errors.
// Since we can't access frontend flags through hasArg, let's manually iterate
OpenPOWER on IntegriCloud