clang-tools 20.0.0git
|
A collection of ClangTidyCheckFactory
instances.
More...
#include <ClangTidyModule.h>
Public Types | |
using | CheckFactory = std::function< std::unique_ptr< ClangTidyCheck >(llvm::StringRef Name, ClangTidyContext *Context)> |
using | FactoryMap = llvm::StringMap< CheckFactory > |
Public Member Functions | |
void | registerCheckFactory (llvm::StringRef Name, CheckFactory Factory) |
Registers check Factory with name Name . | |
template<typename CheckType > | |
void | registerCheck (llvm::StringRef CheckName) |
Registers the CheckType with the name Name . | |
std::vector< std::unique_ptr< ClangTidyCheck > > | createChecks (ClangTidyContext *Context) const |
Create instances of checks that are enabled. | |
std::vector< std::unique_ptr< ClangTidyCheck > > | createChecksForLanguage (ClangTidyContext *Context) const |
Create instances of checks that are enabled for the current Language. | |
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.
using clang::tidy::ClangTidyCheckFactories::CheckFactory = std::function<std::unique_ptr<ClangTidyCheck>( llvm::StringRef Name, ClangTidyContext *Context)> |
Definition at line 29 of file ClangTidyModule.h.
using clang::tidy::ClangTidyCheckFactories::FactoryMap = llvm::StringMap<CheckFactory> |
Definition at line 73 of file ClangTidyModule.h.
|
inline |
Definition at line 74 of file ClangTidyModule.h.
std::vector< std::unique_ptr< ClangTidyCheck > > clang::tidy::ClangTidyCheckFactories::createChecks | ( | ClangTidyContext * | Context | ) | const |
Create instances of checks that are enabled.
Definition at line 24 of file ClangTidyModule.cpp.
std::vector< std::unique_ptr< ClangTidyCheck > > clang::tidy::ClangTidyCheckFactories::createChecksForLanguage | ( | ClangTidyContext * | Context | ) | const |
Create instances of checks that are enabled for the current Language.
Definition at line 34 of file ClangTidyModule.cpp.
Referenced by clang::clangd::ParsedAST::build().
|
inline |
Definition at line 76 of file ClangTidyModule.h.
|
inline |
Definition at line 75 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 Name, and registerCheckFactory().
Referenced by clang::tidy::abseil::AbseilModule::addCheckFactories(), clang::tidy::altera::AlteraModule::addCheckFactories(), clang::tidy::android::AndroidModule::addCheckFactories(), clang::tidy::boost::BoostModule::addCheckFactories(), clang::tidy::bugprone::BugproneModule::addCheckFactories(), clang::tidy::cert::CERTModule::addCheckFactories(), clang::tidy::concurrency::ConcurrencyModule::addCheckFactories(), clang::tidy::cppcoreguidelines::CppCoreGuidelinesModule::addCheckFactories(), clang::tidy::darwin::DarwinModule::addCheckFactories(), clang::tidy::fuchsia::FuchsiaModule::addCheckFactories(), clang::tidy::google::GoogleModule::addCheckFactories(), clang::tidy::hicpp::HICPPModule::addCheckFactories(), clang::tidy::linuxkernel::LinuxKernelModule::addCheckFactories(), clang::tidy::llvm_check::LLVMModule::addCheckFactories(), clang::tidy::llvm_libc::LLVMLibcModule::addCheckFactories(), clang::tidy::misc::MiscModule::addCheckFactories(), clang::tidy::modernize::ModernizeModule::addCheckFactories(), clang::tidy::mpi::MPIModule::addCheckFactories(), clang::tidy::objc::ObjCModule::addCheckFactories(), clang::tidy::openmp::OpenMPModule::addCheckFactories(), clang::tidy::performance::PerformanceModule::addCheckFactories(), clang::tidy::portability::PortabilityModule::addCheckFactories(), clang::tidy::readability::ReadabilityModule::addCheckFactories(), and clang::tidy::zircon::ZirconModule::addCheckFactories().
void clang::tidy::ClangTidyCheckFactories::registerCheckFactory | ( | llvm::StringRef | Name, |
CheckFactory | Factory | ||
) |
Registers check Factory
with name Name
.
For all checks that have default constructors, use registerCheck
.
Definition at line 18 of file ClangTidyModule.cpp.
References Name.
Referenced by registerCheck().