diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-15 12:48:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-15 12:48:25 +0000 |
commit | 6e195426e72282a63f19d0fc448fb1d6730ccd07 (patch) | |
tree | 677d16bd904feed3b2a00330397b88690f50ff81 /clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | |
parent | 707a2e098dd6b30ebf7d6246360c794296eb0ad9 (diff) | |
download | bcm5719-llvm-6e195426e72282a63f19d0fc448fb1d6730ccd07.tar.gz bcm5719-llvm-6e195426e72282a63f19d0fc448fb1d6730ccd07.zip |
[clang-tidy] Add a checker for long functions.
As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:
- Line counting: number of lines including whitespace and comments
- Statement counting: number of statements within compoundStmts.
- Branch counter
In addition a threshold can be picked, warnings are only emitted when it is met.
The thresholds can be configured via a .clang-tidy file.
Differential Revision: http://reviews.llvm.org/D4986
llvm-svn: 217768
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index 489f5b31dd7..6cfc967fbed 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 "FunctionSize.h" #include "RedundantSmartptrGet.h" #include "SwappedArgumentsCheck.h" #include "UndelegatedConstructor.h" @@ -27,6 +28,7 @@ public: CheckFactories.registerCheck<ArgumentCommentCheck>("misc-argument-comment"); CheckFactories.registerCheck<BoolPointerImplicitConversion>( "misc-bool-pointer-implicit-conversion"); + CheckFactories.registerCheck<FunctionSizeCheck>("misc-function-size"); CheckFactories.registerCheck<RedundantSmartptrGet>( "misc-redundant-smartptr-get"); CheckFactories.registerCheck<SwappedArgumentsCheck>( |