llvm-project/clang-tools-extra/clang-tidy
Tamas Zolnai 065480daf2 [clang-tidy] Add MagnitudeBitsUpperLimit option to bugprone-too-small-loop-variable
Summary:
The bugprone-too-small-loop-variable check often catches loop variables which can represent "big enough" values, so we don't actually need to worry about that this variable will overflow in a loop when the code iterates through a container. For example a 32 bit signed integer type's maximum value is 2 147 483 647 and a container's size won't reach this maximum value in most of the cases.
So the idea of this option to allow the user to specify an upper limit (using magnitude bit of the integer type) to filter out those catches which are not interesting for the user, so he/she can focus on the more risky integer incompatibilities.
Next to the option I replaced the term "positive bits" to "magnitude bits" which seems a better naming both in the code and in the name of the new option.

Reviewers: JonasToth, alexfh, aaron.ballman, hokein

Reviewed By: JonasToth

Subscribers: Eugene.Zelenko, xazax.hun, jdoerfert, cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D59870

llvm-svn: 358356
2019-04-14 12:47:48 +00:00
..
abseil [clang-tidy] Move all checks to the new registerPPCallbacks API 2019-03-22 18:58:12 +00:00
android [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
boost [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
bugprone [clang-tidy] Add MagnitudeBitsUpperLimit option to bugprone-too-small-loop-variable 2019-04-14 12:47:48 +00:00
cert [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
cppcoreguidelines [clang-tidy] Move all checks to the new registerPPCallbacks API 2019-03-22 18:58:12 +00:00
fuchsia [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
google [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
hicpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
misc Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer* 2019-04-04 21:06:41 +00:00
modernize [clang-tidy] Fix PR28406 2019-03-29 20:55:29 +00:00
mpi [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
objc [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
openmp [clang-tidy] openmp-exception-escape - a new check 2019-03-22 19:46:25 +00:00
performance [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
plugin [clang-tidy] A new OpenMP module 2019-03-22 19:46:01 +00:00
portability [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
readability [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
tool ClangTidy: Avoid mixing stdout with stderror when dealing with a large number of files. 2019-04-09 11:17:02 +00:00
utils [clang-tidy] openmp-exception-escape - a new check 2019-03-22 19:46:25 +00:00
zircon [clang-tidy] Switch checks to #include "ClangTidyCheck.h" 2019-03-25 12:38:26 +00:00
CMakeLists.txt [clang-tidy] Separate the check-facing interface 2019-03-25 12:36:30 +00:00
ClangTidy.cpp [clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method 2019-04-03 14:03:43 +00:00
ClangTidy.h [clang-tidy] Separate the check-facing interface 2019-03-25 12:36:30 +00:00
ClangTidyCheck.cpp [clang-tidy] Separate the check-facing interface 2019-03-25 12:36:30 +00:00
ClangTidyCheck.h [clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method 2019-04-03 14:03:43 +00:00
ClangTidyDiagnosticConsumer.cpp [clang-tidy] NOLINT support for "clang-diagnostic-*". 2019-03-12 16:11:46 +00:00
ClangTidyDiagnosticConsumer.h [clang-tidy] NOLINT support for "clang-diagnostic-*". 2019-03-12 16:11:46 +00:00
ClangTidyForceLinker.h [clang-tidy] A new OpenMP module 2019-03-22 19:46:01 +00:00
ClangTidyModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyModule.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyModuleRegistry.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyOptions.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyOptions.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyProfiling.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ClangTidyProfiling.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExpandModularHeadersPPCallbacks.cpp [clang-tidy] Fix a compiler warning. 2019-03-22 15:07:18 +00:00
ExpandModularHeadersPPCallbacks.h [clang-tidy] Fix a compiler warning. 2019-03-22 15:07:18 +00:00
add_new_check.py [clang-tidy] ClangTidy.h -> ClangTidyCheck.h 2019-03-25 14:46:51 +00:00
rename_check.py Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00