[PATCH] D59870: [clang-tidy] Add MagnitudeBitsUpperLimit option to bugprone-too-small-loop-variable
Tamás Zolnai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 2 06:33:13 PDT 2019
ztamas marked 3 inline comments as done.
ztamas added inline comments.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst:33
+
+ Upper limit for the magnitue bits of the loop variable. If it's set the check
+ filters out those catches in which the loop variable's type has more magnitude
----------------
JonasToth wrote:
> typo `magnitude`
>
> The commit you reference to the project fixing the "bugs" stated, that the version without conversions is more efficient (by one instruction :)). I think this might be worth a note, that even though the
> code is not a bug in itself it might still be preferable to remove those code locations in the long run.
Typo is fixed
The referenced commit message mentions 32 bit system, where changing integer types was a bit faster. I'm not sure how general this is. I'm not familiar with the low level implementation of integer comparison, so I would not mention something, that I don't actually understand how it works.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59870/new/
https://reviews.llvm.org/D59870
More information about the cfe-commits
mailing list