alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.
Thank you for the updates!
Please re-run the check on LLVM to see what has changed.
Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:53
@@ +52,3 @@
+}
szepet updated the summary for this revision.
szepet updated this revision to Diff 71925.
szepet marked 7 inline comments as done.
szepet added a comment.
Herald added subscribers: mgorny, beanz.
In order to decrease false positive rate, the bitmask specific checker part
investigate only the
alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.
Close, but still a bunch of comments in the docs and a suggestion to fix a
class of false positives.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:210
@@ +209,3
szepet updated this revision to Diff 70324.
szepet marked 4 inline comments as done.
szepet added a comment.
cast to dyn-cast change in order to fix a bug, changes based on comments
https://reviews.llvm.org/D22507
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/EnumMisuseCheck.cpp
aaron.ballman added inline comments.
Comment at: test/clang-tidy/misc-enum-misuse.cpp:3
@@ +2,3 @@
+
+enum Empty {
+};
szepet wrote:
> Could you specify which part of the file seems off? I have run the clang
> format with the same options on testfiles as on the
szepet added inline comments.
Comment at: test/clang-tidy/misc-enum-misuse.cpp:3
@@ +2,3 @@
+
+enum Empty {
+};
Could you specify which part of the file seems off? I have run the clang format
with the same options on testfiles as on the others.
szepet updated this revision to Diff 70017.
szepet marked 11 inline comments as done.
szepet added a comment.
Changes based on comments, fix a cast to dyn_cast bug, description updated
(hopefully it became more clear).
https://reviews.llvm.org/D22507
Files:
clang-tidy/misc/CMakeLists.txt
alexfh requested changes to this revision.
This revision now requires changes to proceed.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:215
@@ +214,3 @@
+"number(s)");
+ diag(RhsExpr->getExprLoc(), "Used here as a bitmask.",
+
alexfh requested changes to this revision.
This revision now requires changes to proceed.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:28
@@ +27,3 @@
+llvm::APSInt BeginVal = EnumDec->enumerator_begin()->getInitVal();
+{
+ const auto MinMaxVal =
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:40
@@ +39,3 @@
+
+// Return the number of EnumConstantDecls in an EnumDecl.
+static int enumLength(const EnumDecl *EnumDec) {
Doxygen comment here as well.
szepet updated this revision to Diff 65966.
szepet marked 12 inline comments as done.
szepet added a comment.
updates based on comments, counter and search functions replaced by std
functions
https://reviews.llvm.org/D22507
Files:
clang-tidy/misc/CMakeLists.txt
Prazek added a subscriber: Prazek.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:19
@@ +18,3 @@
+
+// Stores a min and a max value which describe an interval.
+struct ValueRange {
s/\/\//\/\/\/
In other words, change // to /// (doxygen comment)
etienneb added a comment.
some nits
Comment at: docs/clang-tidy/checks/misc-enum-misuse.rst:37
@@ +36,3 @@
+unsigned flag;
+flag = A | H; //OK, disjoint value intervalls in the enum types > probably
good use
+flag = B | F; //warning, have common values so they are probably
szepet updated this revision to Diff 65310.
szepet added a comment.
full diff submitted
https://reviews.llvm.org/D22507
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/EnumMisuseCheck.cpp
clang-tidy/misc/EnumMisuseCheck.h
clang-tidy/misc/MiscTidyModule.cpp
hokein added a comment.
Seems that you only uploaded the diff part, I only see the updated part of your
patch now, and can't see the whole patch now (The review page says "Context
not available"), could you upload the whole patch again?
Comment at:
aaron.ballman added a subscriber: aaron.ballman.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:31
@@ +30,3 @@
+// Stores a min and a max value which describe an interval.
+struct ValueRange {
+ llvm::APSInt MinVal, MaxVal;
I think this class can be replaced by
szepet marked an inline comment as done.
szepet added a comment.
https://reviews.llvm.org/D22507
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
szepet removed rL LLVM as the repository for this revision.
szepet updated this revision to Diff 64897.
szepet added a comment.
updating patch based on review comments
https://reviews.llvm.org/D22507
Files:
clang-tidy/misc/EnumMisuseCheck.cpp
clang-tidy/misc/EnumMisuseCheck.h
szepet marked 18 inline comments as done.
szepet added a comment.
https://reviews.llvm.org/D22507
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
etienneb added a comment.
drive-by, some comments.
Thanks for the check
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:20
@@ +19,3 @@
+// Return the number of EnumConstantDecls in an EnumDecl.
+static int enumLen(const EnumDecl *EnumDec) {
+ int Counter = 0;
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
Please mention this check in docs/ReleaseNotes.rst. See pre-4.0 branch versions
as example.
Comment at: clang-tidy/misc/EnumMisuseCheck.cpp:116
@@ +115,3 @@
+}
+// if there is only one not
21 matches
Mail list logo