summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e35408876b4..52fe20c3a90 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3803,6 +3803,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (isa<AnalyzeJobAction>(JA))
RenderAnalyzerOptions(Args, CmdArgs, Triple, Input);
+ if (isa<AnalyzeJobAction>(JA) ||
+ (isa<PreprocessJobAction>(JA) && Args.hasArg(options::OPT__analyze)))
+ CmdArgs.push_back("-setup-static-analyzer");
+
// Enable compatilibily mode to avoid analyzer-config related errors.
// Since we can't access frontend flags through hasArg, let's manually iterate
// through them.
OpenPOWER on IntegriCloud