Go to the documentation of this file.
18 #ifndef LLVM_CLANG_STATICANALYZER_FRONTEND_CHECKERREGISTRY_H
19 #define LLVM_CLANG_STATICANALYZER_FRONTEND_CHECKERREGISTRY_H
23 #include "llvm/ADT/StringRef.h"
65 #ifndef CLANG_ANALYZER_API_VERSION_STRING
71 #define CLANG_ANALYZER_API_VERSION_STRING CLANG_VERSION_STRING
76 class AnalyzerOptions;
77 class DiagnosticsEngine;
94 CheckerRegistrationFns = {});
107 template <
typename MGR,
typename T>
static void initializeManager(MGR &mgr) {
108 mgr.template registerChecker<T>();
111 template <
typename T>
static bool returnTrue(
const CheckerManager &mgr) {
119 StringRef FullName, StringRef Desc, StringRef DocsUri,
128 void addChecker(StringRef FullName, StringRef Desc, StringRef DocsUri,
129 bool IsHidden =
false) {
132 addChecker(&CheckerRegistry::initializeManager<CheckerManager, T>,
133 &CheckerRegistry::returnTrue<T>, FullName, Desc, DocsUri,
139 void addDependency(StringRef FullName, StringRef Dependency);
155 StringRef OptionName, StringRef DefaultValStr,
156 StringRef Description, StringRef DevelopmentStatus,
157 bool IsHidden =
false);
172 StringRef OptionName, StringRef DefaultValStr,
173 StringRef Description, StringRef DevelopmentStatus,
174 bool IsHidden =
false);
187 template <
bool IsWeak>
void resolveDependencies();
188 void resolveCheckerAndPackageOptions();
199 #endif // LLVM_CLANG_STATICANALYZER_FRONTEND_CHECKERREGISTRY_H
void initializeRegistry(const CheckerManager &Mgr)
Collects all enabled checkers in the field EnabledCheckers.
Concrete class used by the front-end to report problems and issues.
void addPackage(StringRef FullName)
Adds a package to the registry.
void addPackageOption(StringRef OptionType, StringRef PackageFullName, StringRef OptionName, StringRef DefaultValStr, StringRef Description, StringRef DevelopmentStatus, bool IsHidden=false)
Registers an option to a given package.
void addWeakDependency(StringRef FullName, StringRef Dependency)
Makes the checker with the full name fullName weak depend on the checker called dependency.
void(*)(CheckerManager &) RegisterCheckerFn
Initialization functions perform any necessary setup for a checker.
void addChecker(StringRef FullName, StringRef Desc, StringRef DocsUri, bool IsHidden=false)
Adds a checker to the registry.
void addCheckerOption(StringRef OptionType, StringRef CheckerFullName, StringRef OptionName, StringRef DefaultValStr, StringRef Description, StringRef DevelopmentStatus, bool IsHidden=false)
Registers an option to a given checker.
bool(*)(const CheckerManager &) ShouldRegisterFunction
Stores options for the analyzer from the command line.
void validateCheckerOptions() const
Check if every option corresponds to a specific checker or package.
void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, StringRef FullName, StringRef Desc, StringRef DocsUri, bool IsHidden)
Adds a checker to the registry.
void addDependency(StringRef FullName, StringRef Dependency)
Makes the checker with the full name fullName depend on the checker called dependency.
CheckerRegistry(CheckerRegistryData &Data, ArrayRef< std::string > Plugins, DiagnosticsEngine &Diags, AnalyzerOptions &AnOpts, ArrayRef< std::function< void(CheckerRegistry &)>> CheckerRegistrationFns={})
Manages a set of available checkers for running a static analysis.