diff options
author | Angel Garcia Gomez <angelgarcia@google.com> | 2015-09-29 09:36:41 +0000 |
---|---|---|
committer | Angel Garcia Gomez <angelgarcia@google.com> | 2015-09-29 09:36:41 +0000 |
commit | 26fd0e8b6294e81a983eba9efb06b765e06e3a4e (patch) | |
tree | 61a3542c436f4e50a708eea164a52087b2b98cb5 /clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp | |
parent | 43f5e0848ece8c39752516019588124aa3f895a1 (diff) | |
download | bcm5719-llvm-26fd0e8b6294e81a983eba9efb06b765e06e3a4e.tar.gz bcm5719-llvm-26fd0e8b6294e81a983eba9efb06b765e06e3a4e.zip |
Create modernize-make-unique check.
Summary: create a check that replaces 'std::unique_ptr<type>(new type(args...))' with 'std::make_unique<type>(args...)'. It was on the list of "Ideas for new Tools". It needs to be tested more carefully, but first I wanted to know if you think it is worth the effort.
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13166
llvm-svn: 248785
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp index 568abbdac4b..b780cb8aca5 100644 --- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp @@ -11,6 +11,7 @@ #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" #include "LoopConvertCheck.h" +#include "MakeUniqueCheck.h" #include "PassByValueCheck.h" #include "ReplaceAutoPtrCheck.h" #include "ShrinkToFitCheck.h" @@ -28,6 +29,8 @@ class ModernizeModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { CheckFactories.registerCheck<LoopConvertCheck>("modernize-loop-convert"); + CheckFactories.registerCheck<MakeUniqueCheck>( + "modernize-make-unique"); CheckFactories.registerCheck<PassByValueCheck>("modernize-pass-by-value"); CheckFactories.registerCheck<ReplaceAutoPtrCheck>( "modernize-replace-auto-ptr"); |