Index: include/clang/StaticAnalyzer/Core/CheckerRegistry.h =================================================================== --- include/clang/StaticAnalyzer/Core/CheckerRegistry.h +++ include/clang/StaticAnalyzer/Core/CheckerRegistry.h @@ -13,6 +13,7 @@ #include "clang/Basic/LLVM.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include +#include // FIXME: move this information to an HTML file in docs/. // At the very least, a checker plugin is a dynamic library that exports @@ -122,6 +123,9 @@ /// This output is not intended to be machine-parseable. void printHelp(raw_ostream &out, size_t maxNameChars = 30) const ; + /// Get the list of every registered checker. + std::vector getCheckerList() const; + private: mutable CheckerInfoList Checkers; mutable llvm::StringMap Packages; Index: include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h =================================================================== --- include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h +++ include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h @@ -13,6 +13,7 @@ #include "clang/Basic/LLVM.h" #include #include +#include namespace clang { class AnalyzerOptions; @@ -26,6 +27,7 @@ createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts, ArrayRef plugins, DiagnosticsEngine &diags); + std::vector getCheckerList(ArrayRef plugins); } // end ento namespace } // end namespace clang Index: lib/StaticAnalyzer/Core/CheckerRegistry.cpp =================================================================== --- lib/StaticAnalyzer/Core/CheckerRegistry.cpp +++ lib/StaticAnalyzer/Core/CheckerRegistry.cpp @@ -150,3 +150,14 @@ out << '\n'; } } + +std::vector CheckerRegistry::getCheckerList() const { + std::vector result; + std::sort(Checkers.begin(), Checkers.end(), checkerNameLT); + + for (CheckerInfoList::const_iterator i = Checkers.begin(), e = Checkers.end(); + i != e; ++i) { + result.push_back(i->FullName); + } + return result; +} Index: lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp =================================================================== --- lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp +++ lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp @@ -134,3 +134,7 @@ ClangCheckerRegistry(plugins).printHelp(out); } + +std::vector ento::getCheckerList(ArrayRef plugins){ + return ClangCheckerRegistry(plugins).getCheckerList(); +}