[analyzer] SATestBuild.py: Use driver for analyzing single-file tests.
Don't bother coming up with a -cc1 run-line ourselves.
This, in particular, gets rid of a macOS-specific code path.
llvm-svn: 362009
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py
index 1c96cd8..691ded8 100755
--- a/clang/utils/analyzer/SATestBuild.py
+++ b/clang/utils/analyzer/SATestBuild.py
@@ -343,18 +343,13 @@
BuildScript))
raise Exception()
- CmdPrefix = Clang + " -cc1 "
+ CmdPrefix = Clang + " --analyze "
- # For now, we assume the preprocessed files should be analyzed
- # with the OS X SDK.
- SDKPath = SATestUtils.getSDKPath("macosx")
- if SDKPath is not None:
- CmdPrefix += "-isysroot " + SDKPath + " "
-
- CmdPrefix += "-analyze -analyzer-output=plist -w "
- CmdPrefix += "-analyzer-checker=" + Checkers
+ CmdPrefix += "--analyzer-output plist "
+ CmdPrefix += " -Xclang -analyzer-checker=" + Checkers
CmdPrefix += " -fcxx-exceptions -fblocks "
- CmdPrefix += " -analyzer-config %s " % generateAnalyzerConfig(Args)
+ CmdPrefix += " -Xclang -analyzer-config -Xclang %s "\
+ % generateAnalyzerConfig(Args)
if (Mode == 2):
CmdPrefix += "-std=c++11 "