Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-09-28 Thread Malcolm Parsons via cfe-commits
malcolm.parsons added a subscriber: malcolm.parsons. malcolm.parsons added a comment. This check looks like it implements some of CppCoreGuidelines Bounds.4 https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#bounds4-dont-use-standard-library-functions-and-types-that-are-

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-09-19 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 71835. JDevlieghere added a comment. Herald added subscribers: mgorny, beanz. Still working on comment #2 from Alex but wanted to update my diff since it's been a while and I haven't gotten around to looking into it further. So no need to review yet.

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

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/modernize/UseAlgorithmCheck.cpp:37 @@ +36,3 @@ +static bool areTypesCompatible(QualType Left, QualType Right) { + return getStrippedType(Left) == getStrippedType(Right

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-09 Thread Piotr Padlewski via cfe-commits
2016-08-09 5:49 GMT-07:00 Aaron Ballman : > > I think this boils down to personal preference, which is why I'm > concerned about the check. Either mechanism is correct, so this is > purely a stylistic check in many regards. > > About warnings - well, if someone choose this check to be run, then he

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-09 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 67391. JDevlieghere added a comment. Removed anonymous namespaces in test file. I was playing around with it but forgot to remove it before making my last diff. Repository: rL LLVM https://reviews.llvm.org/D22725 Files: clang-tidy/modernize/CMake

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-09 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 67390. JDevlieghere marked 5 inline comments as done. JDevlieghere added a comment. Fixes issues raised by Alexander and Aaron Repository: rL LLVM https://reviews.llvm.org/D22725 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/Mo

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-09 Thread Aaron Ballman via cfe-commits
On Mon, Aug 8, 2016 at 11:36 PM, Piotr Padlewski wrote: > > > 2016-08-08 8:33 GMT-07:00 Aaron Ballman : >> >> aaron.ballman added inline comments. >> >> >> Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:59-61 >> @@ +58,5 @@ >> + IncludeStyle(utils::IncludeSorter::pars

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Piotr Padlewski via cfe-commits
2016-08-08 8:33 GMT-07:00 Aaron Ballman : > aaron.ballman added inline comments. > > > Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:59-61 > @@ +58,5 @@ > + IncludeStyle(utils::IncludeSorter::parseIncludeStyle( > + Options.get("IncludeStyle", "llvm"))) { > +

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:59-61 @@ +58,5 @@ + IncludeStyle(utils::IncludeSorter::parseIncludeStyle( + Options.get("IncludeStyle", "llvm"))) { + + for (const auto &KeyValue : + {std::make_pair("memcpy",

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:59-61 @@ +58,5 @@ + IncludeStyle(utils::IncludeSorter::parseIncludeStyle( + Options.get("IncludeStyle", "llvm"))) { + + for (const auto &KeyValue : + {std::make_pair("m

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Alexander Kornienko via cfe-commits
alexfh requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:59 @@ -57,1 +58,3 @@ "modernize-use-bool-literals"); +CheckFactories.registerCheck( +"modernize-use-algorithm");

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-08 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D22725#506058, @JDevlieghere wrote: > - Added function pointer test case > - Used placeholders for diagnostics > > I extended the matchers to include `::memcpy` and `::memset` as well > because the check otherwise does not work on my m

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-04 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 66835. JDevlieghere marked 9 inline comments as done. JDevlieghere added a comment. - Added function pointer test case - Used placeholders for diagnostics I extended the matchers to include `::memcpy` and `::memset` as well because the check otherwise d

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-04 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D22725#505020, @JDevlieghere wrote: > Addresses comments from Aaron Ballman > > @aaron.ballman Thanks for the thorough review! Can you check whether the > tests I added address your concerns? Could you also elaborate on the case > with

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-03 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D22725#505020, @JDevlieghere wrote: > Addresses comments from Aaron Ballman > > @aaron.ballman Thanks for the thorough review! Can you check whether the > tests I added address your concerns? Could you also elaborate on the case > with the C-f

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-03 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 66688. JDevlieghere marked 21 inline comments as done. JDevlieghere added a comment. Addresses comments from Aaron Ballman @aaron.ballman Thanks for the thorough review! Can you check whether the tests I added address your concerns? Could you also elabo

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-03 Thread Aaron Ballman via cfe-commits
aaron.ballman requested changes to this revision. This revision now requires changes to proceed. Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:25 @@ +24,3 @@ + +static QualType getStrippedType(QualType T) { + while (const auto *PtrType = T->getAs()) I'd

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-01 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. In https://reviews.llvm.org/D22725#502374, @JDevlieghere wrote: > Addressed comments from Piotr Padlewski > > LLVM compiles with the latest version of this check, however some tests are > failing. I'll investigate the cause of this and update this check if it can > be pr

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-08-01 Thread Jonas Devlieghere via cfe-commits
JDevlieghere updated this revision to Diff 66350. JDevlieghere added a comment. Addressed comments from Piotr Padlewski Repository: rL LLVM https://reviews.llvm.org/D22725 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseAl

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-07-31 Thread Piotr Padlewski via cfe-commits
Prazek added a comment. I see you solved the void and conmpatible types problems. Excellent! Can you post a patch with changes after running LLVM? I would wait for Alex or Aaron to accept it. Comment at: clang-tidy/modernize/UseAlgorithmCheck.cpp:58-60 @@ +57,5 @@ + + for (co

Re: [PATCH] D22725: [clang-tidy] Add check 'modernize-use-algorithm'

2016-07-31 Thread Jonas Devlieghere via cfe-commits
JDevlieghere retitled this revision from "[clang-tidy] Add check 'misc-replace-memcpy'" to "[clang-tidy] Add check 'modernize-use-algorithm'". JDevlieghere updated the summary for this revision. JDevlieghere set the repository for this revision to rL LLVM. JDevlieghere updated this revision to Dif