[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Sorry for breaking the build and thanks for the fixes! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 ___ cfe-commits mailing list cfe-

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D77572#2071045 , @RKSimon wrote: > @mgehre Please can you take at the remaining buildbot failures here : > http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/68662 Pushed a fix for that too.

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment. @mgehre Please can you take at the remaining buildbot failures here : http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/68662 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. This change broke the build: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29716. The build is already fixed by https://github.com/llvm/llvm-project/commit/fd2740143e626ca32432aac0b51b2880a3b1e0bc. Please always run `ninja check-all` before pushi

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Matthias Gehre via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGadd51e152aa6: [clang-tidy] add new check readability-use-anyofallof (authored by mgehre). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://r

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-06-03 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 268120. mgehre added a comment. Implemented njames93's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 Files: clang-tools-extra/clang-tidy/readability/CMakeLi

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-30 Thread Nathan James via Phabricator via cfe-commits
njames93 accepted this revision. njames93 added a comment. LGMT, just a few minor nits though. Comment at: clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp:15-16 +#include "clang/Frontend/CompilerInstance.h" +#include +#include + Fairly certai

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, though please wait a bit for @njames93 to speak up if they still have concerns. Comment at: clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.c

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-25 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 266083. mgehre marked an inline comment as done. mgehre added a comment. Fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 Files: clang-tools-extra/clang-ti

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-25 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre marked 5 inline comments as done. mgehre added a comment. Aaron, thank you very much for taking the time to review this PR. Comment at: clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp:61 + hasBody(allOf(hasDescendant(returns(true)), +

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D77572#1981871 , @mgehre wrote: > Thanks for the comments so far. > I'm a bit lost now. Which changes that cannot wait for the next PR do you > see necessary to get this check merged? I'd be curious to know what @njame

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-05-14 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Ping :-) I'm looking for directions on what the next steps are. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 ___ cfe-commits mailing

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-14 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Thanks for the comments so far. I'm a bit lost now. Which changes that cannot wait for the next PR do you see necessary to get this check merged? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-10 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Right now it would be a great candidate for this - http://lists.llvm.org/pipermail/cfe-dev/2020-March/064980.html, however in its current state I wouldn't say its ready to get the green light right now. No point worrying about the fix-its yet, but when it is time, could

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-10 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment. Thanks @njames93, this is a good examples which I did not consider yet. I agree that only transforming the second loop would make the code worse. I would argue that a human seeing a warning on the second loop might also realize that the first loop can be transformed in a

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-07 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. In D77572#1967956 , @mgehre wrote: > In D77572#1965143 , @njames93 wrote: > > > I'm struggling to see the value of this check though. If it was reworked to > > check for loop in the middle

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-07 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 255814. mgehre added a comment. Review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 Files: clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-07 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre updated this revision to Diff 255812. mgehre added a comment. Review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572 Files: clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-07 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre marked 6 inline comments as done. mgehre added a comment. In D77572#1965143 , @njames93 wrote: > I'm struggling to see the value of this check though. If it was reworked to > check for loop in the middle of a function it would have a lot more value

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. See also suggestion for more generic loop-to-algorithm transformations. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77572/new/ https://reviews.llvm.org/D77572

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-06 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. As no FixIts are made the `IncludeInserter` can be removed. I'm struggling to see the value of this check though. If it was reworked to check for loop in the middle of a function it would have a lot more value. bool all_of = true; for (auto X : V) { if (!X) {

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-06 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp:26 +AST_MATCHER_P(Stmt, nextStmt, internal::Matcher, InnerMatcher) { + const auto &Parents = Finder->getASTContext().getParents(Node); + if (Parents.size() != 1) --

[PATCH] D77572: [clang-tidy] add new check readability-use-anyofallof

2020-04-06 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre created this revision. mgehre added reviewers: aaron.ballman, alexfh, hokein. Herald added subscribers: xazax.hun, mgorny. Herald added a project: clang. Finds range-based for loops that can be replaced by a call to ``std::any_of`` or ``std::all_of``. In C++ 20 mode, suggests ``std::ranges: