summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-10-02 19:09:56 +0000
committerAlexander Kornienko <alexfh@google.com>2014-10-02 19:09:56 +0000
commit8f7e7f73ea54414d86acaf1cf37ea8a1c3d28cec (patch)
tree3b9ebac2f3f0ded6171c7dd52aefacd9862414d5 /clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
parent325111bcc6ee751e16faeeca405ed4b103b2ffce (diff)
downloadbcm5719-llvm-8f7e7f73ea54414d86acaf1cf37ea8a1c3d28cec.tar.gz
bcm5719-llvm-8f7e7f73ea54414d86acaf1cf37ea8a1c3d28cec.zip
[clang-tidy] Add check misc-braces-around-statements.
This check looks for if statements and loops: for, range-for, while and do-while, and verifies that the inside statements are inside braces '{}'. If not, proposes to add braces around them. Example: if (condition) action(); becomes if (condition) { action(); } This check ought to be used with the -format option, so that the braces be well-formatted. Patch by Marek Kurdej! http://reviews.llvm.org/D5395 llvm-svn: 218898
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
index 6cfc967fbed..c24897d9ffb 100644
--- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
@@ -12,6 +12,7 @@
#include "../ClangTidyModuleRegistry.h"
#include "ArgumentCommentCheck.h"
#include "BoolPointerImplicitConversion.h"
+#include "BracesAroundStatementsCheck.h"
#include "FunctionSize.h"
#include "RedundantSmartptrGet.h"
#include "SwappedArgumentsCheck.h"
@@ -28,6 +29,8 @@ public:
CheckFactories.registerCheck<ArgumentCommentCheck>("misc-argument-comment");
CheckFactories.registerCheck<BoolPointerImplicitConversion>(
"misc-bool-pointer-implicit-conversion");
+ CheckFactories.registerCheck<BracesAroundStatementsCheck>(
+ "misc-braces-around-statements");
CheckFactories.registerCheck<FunctionSizeCheck>("misc-function-size");
CheckFactories.registerCheck<RedundantSmartptrGet>(
"misc-redundant-smartptr-get");
OpenPOWER on IntegriCloud