Add -analyze action to run static analyzer, instead of inferring from
individual checker options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62634 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 741eddc..747f7e1 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -107,6 +107,8 @@
"Run preprocessor, emit preprocessed file"),
clEnumValN(DumpRawTokens, "dump-raw-tokens",
"Lex file in raw mode and dump raw tokens"),
+ clEnumValN(RunAnalysis, "analyze",
+ "Run static analysis engine"),
clEnumValN(DumpTokens, "dump-tokens",
"Run preprocessor, dump internal rep of tokens"),
clEnumValN(ParseNoop, "parse-noop",
@@ -1298,7 +1300,6 @@
return CreateBlockRewriter(InFile, OutputFile, Diag, LangOpts);
case RunAnalysis:
- assert (!AnalysisList.empty());
return CreateAnalysisConsumer(&AnalysisList[0],
&AnalysisList[0]+AnalysisList.size(),
AnalysisStoreOpt, AnalysisDiagOpt,
@@ -1545,10 +1546,7 @@
exit(1);
}
- // Are we invoking one or more source analyses?
- if (!AnalysisList.empty() && ProgAction == ParseSyntaxOnly)
- ProgAction = RunAnalysis;
- else if (!InheritanceViewCls.empty()) // C++ visualization?
+ if (!InheritanceViewCls.empty()) // C++ visualization?
ProgAction = InheritanceView;
llvm::OwningPtr<SourceManager> SourceMgr;