2013-07-29 16:19:24 +08:00
|
|
|
//===--- tools/extra/clang-tidy/ClangTidyModule.cpp - Clang tidy tool -----===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file Implements classes required to build clang-tidy modules.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ClangTidyModule.h"
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace tidy {
|
|
|
|
|
2014-09-12 16:53:36 +08:00
|
|
|
void ClangTidyCheckFactories::registerCheckFactory(StringRef Name,
|
|
|
|
CheckFactory Factory) {
|
2016-06-15 23:46:10 +08:00
|
|
|
Factories[Name] = std::move(Factory);
|
2013-07-29 16:19:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ClangTidyCheckFactories::createChecks(
|
2014-09-12 16:53:36 +08:00
|
|
|
ClangTidyContext *Context,
|
|
|
|
std::vector<std::unique_ptr<ClangTidyCheck>> &Checks) {
|
2014-03-06 18:17:46 +08:00
|
|
|
for (const auto &Factory : Factories) {
|
2017-05-17 22:39:47 +08:00
|
|
|
if (Context->isCheckEnabled(Factory.first))
|
2014-09-12 16:53:36 +08:00
|
|
|
Checks.emplace_back(Factory.second(Factory.first, Context));
|
2013-07-29 16:19:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-16 19:27:57 +08:00
|
|
|
ClangTidyOptions ClangTidyModule::getModuleOptions() {
|
|
|
|
return ClangTidyOptions();
|
|
|
|
}
|
|
|
|
|
2013-07-29 16:19:24 +08:00
|
|
|
} // namespace tidy
|
|
|
|
} // namespace clang
|