clang-tools
3.8.0
|
A collection of ClangTidyCheckFactory
instances.
More...
#include <ClangTidyModule.h>
Public Types | |
typedef std::function < ClangTidyCheck *(StringRef Name, ClangTidyContext *Context)> | CheckFactory |
typedef std::map< std::string, CheckFactory > | FactoryMap |
Public Member Functions | |
void | registerCheckFactory (StringRef Name, CheckFactory Factory) |
Registers check Factory with name Name . More... | |
template<typename CheckType > | |
void | registerCheck (StringRef CheckName) |
Registers the CheckType with the name Name . More... | |
void | createChecks (ClangTidyContext *Context, std::vector< std::unique_ptr< ClangTidyCheck >> &Checks) |
Create instances of all checks matching CheckRegexString and store them in Checks . More... | |
FactoryMap::const_iterator | begin () const |
FactoryMap::const_iterator | end () const |
bool | empty () const |
A collection of ClangTidyCheckFactory
instances.
All clang-tidy modules register their check factories with an instance of this object.
Definition at line 27 of file ClangTidyModule.h.
typedef std::function<ClangTidyCheck *( StringRef Name, ClangTidyContext *Context)> clang::tidy::ClangTidyCheckFactories::CheckFactory |
Definition at line 30 of file ClangTidyModule.h.
typedef std::map<std::string, CheckFactory> clang::tidy::ClangTidyCheckFactories::FactoryMap |
Definition at line 72 of file ClangTidyModule.h.
|
inline |
Definition at line 73 of file ClangTidyModule.h.
void clang::tidy::ClangTidyCheckFactories::createChecks | ( | ClangTidyContext * | Context, |
std::vector< std::unique_ptr< ClangTidyCheck >> & | Checks | ||
) |
Create instances of all checks matching CheckRegexString
and store them in Checks
.
The caller takes ownership of the return ClangTidyChecks
.
Definition at line 24 of file ClangTidyModule.cpp.
References Checks, clang::tidy::GlobList::contains(), and clang::tidy::ClangTidyContext::getChecksFilter().
|
inline |
Definition at line 75 of file ClangTidyModule.h.
|
inline |
Definition at line 74 of file ClangTidyModule.h.
|
inline |
Registers the CheckType
with the name Name
.
This method should be used for all ClangTidyChecks
that don't require constructor parameters.
For example, if have a clang-tidy check like:
you can register it with:
Definition at line 58 of file ClangTidyModule.h.
References Context, Name, and registerCheckFactory().
Referenced by clang::tidy::performance::PerformanceModule::addCheckFactories(), clang::tidy::llvm::LLVMModule::addCheckFactories(), clang::tidy::cert::CERTModule::addCheckFactories(), clang::tidy::cppcoreguidelines::CppCoreGuidelinesModule::addCheckFactories(), clang::tidy::modernize::ModernizeModule::addCheckFactories(), clang::tidy::readability::ReadabilityModule::addCheckFactories(), clang::tidy::google::GoogleModule::addCheckFactories(), and clang::tidy::misc::MiscModule::addCheckFactories().
void clang::tidy::ClangTidyCheckFactories::registerCheckFactory | ( | StringRef | Name, |
CheckFactory | Factory | ||
) |
Registers check Factory
with name Name
.
For all checks that have default constructors, use registerCheck
.
Definition at line 19 of file ClangTidyModule.cpp.
References Name.
Referenced by registerCheck().