summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-06-05 13:31:45 +0000
committerAlexander Kornienko <alexfh@google.com>2014-06-05 13:31:45 +0000
commita46952221e44cb53b707bca433b5177191de779d (patch)
tree37dc2ed74d55a6923b224b86f55027fdf7e9991d /clang-tools-extra/clang-tidy/ClangTidyModule.cpp
parent57eba53a015e1541e6d8a89382a23d9adc7ebf3b (diff)
Allow per-file clang-tidy options.
Summary: This patch makes it possible for clang-tidy clients to provide different options for different translation units. The option, which doesn't make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions struct. Added parsing of ClangTidyOptions. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3979 llvm-svn: 210260
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/ClangTidyModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
index b79194d44ef2..40812a2eba13 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp
@@ -27,12 +27,13 @@ void ClangTidyCheckFactories::addCheckFactory(StringRef Name,
}
void ClangTidyCheckFactories::createChecks(
- ChecksFilter &Filter, SmallVectorImpl<ClangTidyCheck *> &Checks) {
+ ChecksFilter &Filter,
+ std::vector<std::unique_ptr<ClangTidyCheck>> &Checks) {
for (const auto &Factory : Factories) {
if (Filter.isCheckEnabled(Factory.first)) {
ClangTidyCheck *Check = Factory.second->createCheck();
Check->setName(Factory.first);
- Checks.push_back(Check);
+ Checks.emplace_back(Check);
}
}
}