diff options
author | Samuel Benzaquen <sbenza@google.com> | 2014-03-27 17:42:26 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2014-03-27 17:42:26 +0000 |
commit | 3a571019c8b17e6f5896c5b2a80e3a854011eb32 (patch) | |
tree | 6a7f609f79d924e428298252097304d9167f26d3 /clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | |
parent | b517c8128e8255a205d2e2da65a26f38e2474fcb (diff) | |
download | bcm5719-llvm-3a571019c8b17e6f5896c5b2a80e3a854011eb32.tar.gz bcm5719-llvm-3a571019c8b17e6f5896c5b2a80e3a854011eb32.zip |
Add clang-tidy check to remove redundant .get() calls on smart pointers.
Summary:
This check finds and removes redundant .get() calls on smart pointers.
Example:
ptr.get()->Foo() ==> ptr->Foo()
Reviewers: alexfh
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3186
llvm-svn: 204947
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index f7f657addfa..b89e2dcad48 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -11,6 +11,7 @@ #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" #include "ArgumentCommentCheck.h" +#include "RedundantSmartptrGet.h" namespace clang { namespace tidy { @@ -18,9 +19,12 @@ namespace tidy { class MiscModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { - CheckFactories.addCheckFactory( - "misc-argument-comment", - new ClangTidyCheckFactory<ArgumentCommentCheck>()); + CheckFactories.addCheckFactory( + "misc-argument-comment", + new ClangTidyCheckFactory<ArgumentCommentCheck>()); + CheckFactories.addCheckFactory( + "misc-redundant-smartptr-get", + new ClangTidyCheckFactory<RedundantSmartptrGet>()); } }; |