summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-07-16 14:30:19 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-07-16 14:30:19 +0000
commitebab1500e0a0bb6df3510e6d9e3d45f7295704ab (patch)
tree1846c4efc83f58ae8aca0d194f781cc2cc780b60 /clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
parent2252cbf4e89d76b1c39da89b01d67b3e2b73154b (diff)
downloadbcm5719-llvm-ebab1500e0a0bb6df3510e6d9e3d45f7295704ab.tar.gz
bcm5719-llvm-ebab1500e0a0bb6df3510e6d9e3d45f7295704ab.zip
[clang-tidy] Add a checker for zero-length memset.
If there's memset(x, y, 0) in the code it's most likely a mistake. The checker suggests a fix-it to swap 'y' and '0'. I think this has the potential to be promoted into a general clang warning after some testing in clang-tidy. Differential Revision: http://reviews.llvm.org/D4535 llvm-svn: 213155
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
index 416f48d1fa3..1681727061c 100644
--- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
@@ -13,6 +13,7 @@
#include "AvoidCStyleCastsCheck.h"
#include "ExplicitConstructorCheck.h"
#include "ExplicitMakePairCheck.h"
+#include "MemsetZeroLengthCheck.h"
#include "NamedParameterCheck.h"
#include "OverloadedUnaryAndCheck.h"
#include "StringReferenceMemberCheck.h"
@@ -46,6 +47,9 @@ public:
"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(
OpenPOWER on IntegriCloud