summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/ClangTidyModule.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
index 1d1c0d12a33..f6e4daf1c30 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
@@ -16,19 +16,18 @@
namespace clang {
namespace tidy {
-void ClangTidyCheckFactories::registerCheckFactory(
- StringRef Name, std::function<ClangTidyCheck *()> Factory) {
+void ClangTidyCheckFactories::registerCheckFactory(StringRef Name,
+ CheckFactory Factory) {
Factories[Name] = Factory;
}
void ClangTidyCheckFactories::createChecks(
- GlobList &Filter, std::vector<std::unique_ptr<ClangTidyCheck>> &Checks) {
+ ClangTidyContext *Context,
+ std::vector<std::unique_ptr<ClangTidyCheck>> &Checks) {
+ GlobList &Filter = Context->getChecksFilter();
for (const auto &Factory : Factories) {
- if (Filter.contains(Factory.first)) {
- ClangTidyCheck *Check = Factory.second();
- Check->setName(Factory.first);
- Checks.emplace_back(Check);
- }
+ if (Filter.contains(Factory.first))
+ Checks.emplace_back(Factory.second(Factory.first, Context));
}
}
OpenPOWER on IntegriCloud