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
77class 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,
129 bool IsHidden =
false) {
132 addChecker(&CheckerRegistry::initializeManager<CheckerManager, T>,
133 &CheckerRegistry::returnTrue<T>,
FullName, Desc, DocsUri,
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();
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines version macros and version-related utility functions for Clang.
Stores options for the analyzer from the command line.
Concrete class used by the front-end to report problems and issues.
Manages a set of available checkers for running a static analysis.
void addCheckerOption(StringRef OptionType, StringRef CheckerFullName, StringRef OptionName, StringRef DefaultValStr, StringRef Description, StringRef DevelopmentStatus, bool IsHidden=false)
Registers an option to a given checker.
void addWeakDependency(StringRef FullName, StringRef Dependency)
Makes the checker with the full name fullName weak depend on the checker called dependency.
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 initializeRegistry(const CheckerManager &Mgr)
Collects all enabled checkers in the field EnabledCheckers.
void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, StringRef FullName, StringRef Desc, StringRef DocsUri, bool IsHidden)
Adds a checker to the registry.
void addPackage(StringRef FullName)
Adds a package to the registry.
void validateCheckerOptions() const
Check if every option corresponds to a specific checker or package.
void addChecker(StringRef FullName, StringRef Desc, StringRef DocsUri, bool IsHidden=false)
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.
bool(*)(const CheckerManager &) ShouldRegisterFunction
void(*)(CheckerManager &) RegisterCheckerFn
Initialization functions perform any necessary setup for a checker.
The JSON file list parser is used to communicate input to InstallAPI.