diff options
author | Alexander Kornienko <alexfh@google.com> | 2014-09-10 11:06:43 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2014-09-10 11:06:43 +0000 |
commit | be8c143dd604ecdbe246d4a3bfdc0483e873557f (patch) | |
tree | 9e5cd12f7d7c12c54ce69407eedd8032bf4964f0 /clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp | |
parent | b6bbf341cb1939a03395b169c59f2fe0628c6042 (diff) | |
download | bcm5719-llvm-be8c143dd604ecdbe246d4a3bfdc0483e873557f.tar.gz bcm5719-llvm-be8c143dd604ecdbe246d4a3bfdc0483e873557f.zip |
Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative to
addCheckFactory: registerCheck.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5288
llvm-svn: 217489
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp index c945e74ae3d..34c17bbf5cf 100644 --- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp @@ -29,36 +29,26 @@ namespace tidy { class GoogleModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { - CheckFactories.addCheckFactory( - "google-build-explicit-make-pair", - new ClangTidyCheckFactory<build::ExplicitMakePairCheck>()); - CheckFactories.addCheckFactory( - "google-build-namespaces", - new ClangTidyCheckFactory<build::UnnamedNamespaceInHeaderCheck>()); - CheckFactories.addCheckFactory( - "google-build-using-namespace", - new ClangTidyCheckFactory<build::UsingNamespaceDirectiveCheck>()); - CheckFactories.addCheckFactory( - "google-explicit-constructor", - new ClangTidyCheckFactory<ExplicitConstructorCheck>()); - CheckFactories.addCheckFactory( - "google-runtime-int", - new ClangTidyCheckFactory<runtime::IntegerTypesCheck>()); - CheckFactories.addCheckFactory( - "google-runtime-operator", - new ClangTidyCheckFactory<runtime::OverloadedUnaryAndCheck>()); - CheckFactories.addCheckFactory( - "google-runtime-member-string-references", - new ClangTidyCheckFactory<runtime::StringReferenceMemberCheck>()); - CheckFactories.addCheckFactory( - "google-runtime-memset", - new ClangTidyCheckFactory<runtime::MemsetZeroLengthCheck>()); - CheckFactories.addCheckFactory( - "google-readability-casting", - new ClangTidyCheckFactory<readability::AvoidCStyleCastsCheck>()); - CheckFactories.addCheckFactory( - "google-readability-function", - new ClangTidyCheckFactory<readability::NamedParameterCheck>()); + CheckFactories.registerCheck<build::ExplicitMakePairCheck>( + "google-build-explicit-make-pair"); + CheckFactories.registerCheck<build::UnnamedNamespaceInHeaderCheck>( + "google-build-namespaces"); + CheckFactories.registerCheck<build::UsingNamespaceDirectiveCheck>( + "google-build-using-namespace"); + CheckFactories.registerCheck<ExplicitConstructorCheck>( + "google-explicit-constructor"); + CheckFactories.registerCheck<runtime::IntegerTypesCheck>( + "google-runtime-int"); + CheckFactories.registerCheck<runtime::OverloadedUnaryAndCheck>( + "google-runtime-operator"); + CheckFactories.registerCheck<runtime::StringReferenceMemberCheck>( + "google-runtime-member-string-references"); + CheckFactories.registerCheck<runtime::MemsetZeroLengthCheck>( + "google-runtime-memset"); + CheckFactories.registerCheck<readability::AvoidCStyleCastsCheck>( + "google-readability-casting"); + CheckFactories.registerCheck<readability::NamedParameterCheck>( + "google-readability-function"); } }; |