|
@@ -101,6 +101,16 @@ void ClangCheckerRegistry::warnIncompatible(DiagnosticsEngine *diags,
|
|
|
<< pluginAPIVersion;
|
|
|
}
|
|
|
|
|
|
+static SmallVector<CheckerOptInfo, 8>
|
|
|
+getCheckerOptList(const AnalyzerOptions &opts) {
|
|
|
+ SmallVector<CheckerOptInfo, 8> checkerOpts;
|
|
|
+ for (unsigned i = 0, e = opts.CheckersControlList.size(); i != e; ++i) {
|
|
|
+ const std::pair<std::string, bool> &opt = opts.CheckersControlList[i];
|
|
|
+ checkerOpts.push_back(CheckerOptInfo(opt.first.c_str(), opt.second));
|
|
|
+ }
|
|
|
+ return checkerOpts;
|
|
|
+}
|
|
|
+
|
|
|
std::unique_ptr<CheckerManager>
|
|
|
ento::createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
|
|
|
ArrayRef<std::string> plugins,
|
|
@@ -108,11 +118,7 @@ ento::createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
|
|
|
std::unique_ptr<CheckerManager> checkerMgr(
|
|
|
new CheckerManager(langOpts, &opts));
|
|
|
|
|
|
- SmallVector<CheckerOptInfo, 8> checkerOpts;
|
|
|
- for (unsigned i = 0, e = opts.CheckersControlList.size(); i != e; ++i) {
|
|
|
- const std::pair<std::string, bool> &opt = opts.CheckersControlList[i];
|
|
|
- checkerOpts.push_back(CheckerOptInfo(opt.first.c_str(), opt.second));
|
|
|
- }
|
|
|
+ SmallVector<CheckerOptInfo, 8> checkerOpts = getCheckerOptList(opts);
|
|
|
|
|
|
ClangCheckerRegistry allCheckers(plugins, &diags);
|
|
|
allCheckers.initializeManager(*checkerMgr, checkerOpts);
|
|
@@ -137,3 +143,12 @@ void ento::printCheckerHelp(raw_ostream &out, ArrayRef<std::string> plugins) {
|
|
|
|
|
|
ClangCheckerRegistry(plugins).printHelp(out);
|
|
|
}
|
|
|
+
|
|
|
+void ento::printEnabledCheckerList(raw_ostream &out,
|
|
|
+ ArrayRef<std::string> plugins,
|
|
|
+ const AnalyzerOptions &opts) {
|
|
|
+ out << "OVERVIEW: Clang Static Analyzer Enabled Checkers List\n\n";
|
|
|
+
|
|
|
+ SmallVector<CheckerOptInfo, 8> checkerOpts = getCheckerOptList(opts);
|
|
|
+ ClangCheckerRegistry(plugins).printList(out, checkerOpts);
|
|
|
+}
|