Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-23 Thread Alexander Kornienko via cfe-commits
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 @@ +}

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-20 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-07 Thread Alexander Kornienko via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-05 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-02 Thread Aaron Ballman via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-01 Thread Peter Szecsi via cfe-commits
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.

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-09-01 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-08-24 Thread Alexander Kornienko via cfe-commits
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.", +

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-08-17 Thread Alexander Kornienko via cfe-commits
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 =

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-29 Thread Aaron Ballman via cfe-commits
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.

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-28 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-25 Thread Piotr Padlewski via cfe-commits
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)

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-25 Thread Etienne Bergeron via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-25 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-22 Thread Haojian Wu via cfe-commits
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:

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-21 Thread Aaron Ballman via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-21 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-21 Thread Peter Szecsi via 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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-21 Thread Peter Szecsi via cfe-commits
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

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-19 Thread Etienne Bergeron via 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;

Re: [PATCH] D22507: Clang-tidy - Enum misuse check

2016-07-19 Thread Eugene Zelenko via cfe-commits
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