aboutsummaryrefslogtreecommitdiff
path: root/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
commitac560ec8cb8ae943afe2f10a954f70b146cd1cd6 (patch)
treea8c407786a6d9933e178a1fdfcd9e6080af49ec4 /clang-tidy/ClangTidyModule.cpp
parente04d0b1c607170f31ce312ee2c6181bbda6f1ee1 (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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/ClangTidyModule.cpp')
-rw-r--r--clang-tidy/ClangTidyModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tidy/ClangTidyModule.cpp b/clang-tidy/ClangTidyModule.cpp
index b79194d4..40812a2e 100644
--- a/clang-tidy/ClangTidyModule.cpp
+++ b/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);
}
}
}