20#ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKERREGISTRYDATA_H
21#define LLVM_CLANG_STATICANALYZER_CORE_CHECKERREGISTRYDATA_H
24#include "llvm/ADT/SetVector.h"
25#include "llvm/ADT/StringMap.h"
26#include "llvm/ADT/StringRef.h"
27#include "llvm/Support/raw_ostream.h"
61 "Unknown command line option type!");
65 "Invalid value for boolean command line option! Maybe incorrect "
66 "parameters to the addCheckerOption or addPackageOption method?");
70 "Invalid value for integer command line option! Maybe incorrect "
71 "parameters to the addCheckerOption or addPackageOption method?");
76 "Invalid development status!");
79 LLVM_DUMP_METHOD
void dump()
const;
80 LLVM_DUMP_METHOD
void dumpToStream(llvm::raw_ostream &Out)
const;
138 LLVM_DUMP_METHOD
void dump()
const;
139 LLVM_DUMP_METHOD
void dumpToStream(llvm::raw_ostream &Out)
const;
158 LLVM_DUMP_METHOD
void dump()
const;
159 LLVM_DUMP_METHOD
void dumpToStream(llvm::raw_ostream &Out)
const;
164namespace checker_registry {
168 return Lhs.FullName < Rhs.FullName;
175template <
class CheckerOrPackageInfoList>
176std::conditional_t<std::is_const<CheckerOrPackageInfoList>::value,
177 typename CheckerOrPackageInfoList::const_iterator,
178 typename CheckerOrPackageInfoList::iterator>
181 using CheckerOrPackage =
typename CheckerOrPackageInfoList::value_type;
184 assert(llvm::is_sorted(Collection, CheckerOrPackageFullNameLT{}) &&
185 "In order to efficiently gather checkers/packages, this function "
186 "expects them to be already sorted!");
188 return llvm::lower_bound(Collection, CheckerOrPackage(
FullName),
189 CheckerOrPackageFullNameLT{});
217 size_t MaxNameChars = 30)
const;
220 raw_ostream &Out)
const;
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Stores options for the analyzer from the command line.
std::conditional_t< std::is_const< CheckerOrPackageInfoList >::value, typename CheckerOrPackageInfoList::const_iterator, typename CheckerOrPackageInfoList::iterator > binaryFind(CheckerOrPackageInfoList &Collection, StringRef FullName)
llvm::iterator_range< CheckerInfoList::iterator > CheckerInfoListRange
bool(*)(const CheckerManager &) ShouldRegisterFunction
std::vector< CheckerInfo > CheckerInfoList
void(*)(CheckerManager &) RegisterCheckerFn
Initialization functions perform any necessary setup for a checker.
llvm::SetVector< const CheckerInfo * > CheckerInfoSet
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
ConstCheckerInfoList WeakDependencies
RegisterCheckerFn Initialize
ConstCheckerInfoList Dependencies
bool isEnabled(const CheckerManager &mgr) const
bool operator==(const CheckerInfo &Rhs) const
ShouldRegisterFunction ShouldRegister
StringRef DocumentationUri
CmdLineOptionList CmdLineOptions
CheckerInfo(StringRef FullName)
LLVM_DUMP_METHOD void dumpToStream(llvm::raw_ostream &Out) const
bool isDisabled(const CheckerManager &mgr) const
LLVM_DUMP_METHOD void dump() const
CheckerInfo(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, StringRef Name, StringRef Desc, StringRef DocsUri, bool IsHidden)
llvm::SmallVector< std::pair< StringRef, CmdLineOption >, 0 > PackageOptions
Contains all (FullName, CmdLineOption) pairs.
CheckerInfoListRange getMutableCheckersForCmdLineArg(StringRef CmdLineArg)
void printCheckerOptionList(const AnalyzerOptions &AnOpts, raw_ostream &Out) const
llvm::SmallVector< std::pair< StringRef, StringRef >, 0 > Dependencies
CheckerInfoSet EnabledCheckers
llvm::SmallVector< std::pair< StringRef, StringRef >, 0 > WeakDependencies
void printCheckerWithDescList(const AnalyzerOptions &AnOpts, raw_ostream &Out, size_t MaxNameChars=30) const
Prints the name and description of all checkers in this registry.
void printEnabledCheckerList(raw_ostream &Out) const
llvm::SmallVector< std::pair< StringRef, CmdLineOption >, 0 > CheckerOptions
llvm::StringMap< size_t > PackageSizes
Used for counting how many checkers belong to a certain package in the Checkers field.
Specifies a command line option.
CmdLineOption(StringRef OptionType, StringRef OptionName, StringRef DefaultValStr, StringRef Description, StringRef DevelopmentStatus, bool IsHidden)
StringRef DevelopmentStatus
LLVM_DUMP_METHOD void dump() const
LLVM_DUMP_METHOD void dumpToStream(llvm::raw_ostream &Out) const
CmdLineOptionList CmdLineOptions
PackageInfo(StringRef FullName)
LLVM_DUMP_METHOD void dumpToStream(llvm::raw_ostream &Out) const
bool operator==(const PackageInfo &Rhs) const
LLVM_DUMP_METHOD void dump() const
bool operator()(const T &Lhs, const T &Rhs)