[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-24 Thread Mads Ravn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301167: [clang-tidy] New check: modernize-replace-random-shuffle. (authored by madsravn). Changed prior to commit: https://reviews.llvm.org/D30158?vs=96303=96362#toc Repository: rL LLVM

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#734810, @aaron.ballman wrote: > This continues to LGTM; do you need someone to land the patch for you? I will remove the extra newline and land the patch tomorrow. Thanks! :) https://reviews.llvm.org/D30158

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This continues to LGTM; do you need someone to land the patch for you? Comment at: test/clang-tidy/modernize-replace-random-shuffle.cpp:40 + + + std::shuffle(vec.begin(), vec.end()); Can remove the extra newline.

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 96303. madsravn added a comment. Small changes to code due to comments. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-10 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. There are a few small nits I've mentioned, but otherwise LGTM. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:34-35 + + const auto first =

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-04-10 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#702778, @jroelofs wrote: > In https://reviews.llvm.org/D30158#702760, @madsravn wrote: > > > In https://reviews.llvm.org/D30158#699342, @jroelofs wrote: > > > > > In https://reviews.llvm.org/D30158#699132, @madsravn wrote: > > > > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-16 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs added a comment. In https://reviews.llvm.org/D30158#702760, @madsravn wrote: > In https://reviews.llvm.org/D30158#699342, @jroelofs wrote: > > > In https://reviews.llvm.org/D30158#699132, @madsravn wrote: > > > > > In https://reviews.llvm.org/D30158#698871, @aaron.ballman wrote: > > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-16 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#699342, @jroelofs wrote: > In https://reviews.llvm.org/D30158#699132, @madsravn wrote: > > > In https://reviews.llvm.org/D30158#698871, @aaron.ballman wrote: > > > > > In https://reviews.llvm.org/D30158#696534, @madsravn wrote: > > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-13 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs added a comment. In https://reviews.llvm.org/D30158#699132, @madsravn wrote: > In https://reviews.llvm.org/D30158#698871, @aaron.ballman wrote: > > > In https://reviews.llvm.org/D30158#696534, @madsravn wrote: > > > > > Any updates on this? > > > > > > Have you run it over the test

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-13 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#698871, @aaron.ballman wrote: > In https://reviews.llvm.org/D30158#696534, @madsravn wrote: > > > Any updates on this? > > > Have you run it over the test suite on the revision before random_shuffle was > removed from libc++? I

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D30158#696534, @madsravn wrote: > Any updates on this? Have you run it over the test suite on the revision before random_shuffle was removed from libc++? https://reviews.llvm.org/D30158

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-09 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. Any updates on this? https://reviews.llvm.org/D30158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs added a comment. In https://reviews.llvm.org/D30158#690032, @madsravn wrote: > Looks good for the two tests the are for `random_shuffle` in llvm libc++. There were a lot more some time ago, before @mclow.lists performed this transformation on libc++'s testsuite. You might want to try

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. Looks good for the two tests the are for `random_shuffle` in llvm libc++. https://reviews.llvm.org/D30158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added a comment. In https://reviews.llvm.org/D30158#689904, @aaron.ballman wrote: > Out of curiosity, have you run this over libc++ or libstdc++ test suites > involving `std::random_shuffle`? If so, were the results acceptable? I haven't. Good idea. I will get onto that. I don't have

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 90223. madsravn added a comment. Last small changes based on comments. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Out of curiosity, have you run this over libc++ or libstdc++ test suites involving `std::random_shuffle`? If so, were the results acceptable? I think this generally LGTM (aside from the minor nit about naming), but I'd like to hear from @mclow.lists where this

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; aaron.ballman wrote: > madsravn wrote: > > aaron.ballman wrote: > > > madsravn wrote: > > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; madsravn wrote: > aaron.ballman wrote: > > madsravn wrote: > > > aaron.ballman wrote: > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; aaron.ballman wrote: > madsravn wrote: > > aaron.ballman wrote: > > > madsravn wrote: > > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; madsravn wrote: > aaron.ballman wrote: > > madsravn wrote: > > > aaron.ballman wrote: > > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn marked an inline comment as done. madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; aaron.ballman wrote: > madsravn wrote: > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; madsravn wrote: > aaron.ballman wrote: > > Is there a reason this needs to capture

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn marked 9 inline comments as done. madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:77 + + auto Diag = [=]() { +std::string Message = ReplaceMessage; aaron.ballman wrote: > Is there a reason this needs

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-03-01 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 90148. madsravn added a comment. Updated patch according to comments by Ballman. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:25 +static const StringRef ReplaceMessage = +"do not use 'random_shuffle'. It is deprecated and replaced by 'shuffle'."; + Diagnostics are not full sentences.

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-27 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 89919. madsravn added a comment. Minor update to fix spelling mistake. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-26 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 89817. madsravn marked an inline comment as done. madsravn added a comment. Made small changes based on comments. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-24 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.h:21 +/// std::random_shuffle will be removed as of C++17. This check will find and +/// replace all occurences of std::random_shuffle with std::shuffle. +/// Typo

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn marked 18 inline comments as done. madsravn added inline comments. Comment at: test/clang-tidy/modernize-replace-random-shuffle.cpp:50 + // CHECK-MESSAGE: [[@LINE-1]]:3: warning: do not use 'random_shuffle'. It is deprecated and replaced by 'shuffle'. The old user

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-23 Thread Mads Ravn via Phabricator via cfe-commits
madsravn updated this revision to Diff 89543. madsravn added a comment. Updated the code based on comments received. https://reviews.llvm.org/D30158 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:81 + Stream << "shuffle("; + FirstArgument->printPretty(Stream, nullptr, Ctx.getPrintingPolicy()); + Stream << ", "; xazax.hun wrote: > madsravn wrote: > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:81 + Stream << "shuffle("; + FirstArgument->printPretty(Stream, nullptr, Ctx.getPrintingPolicy()); + Stream << ", "; madsravn wrote: > xazax.hun wrote: > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:81 + Stream << "shuffle("; + FirstArgument->printPretty(Stream, nullptr, Ctx.getPrintingPolicy()); + Stream << ", "; xazax.hun wrote: > madsravn wrote: > >

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:30 +" The old user defined 'RandomFunction' is not usable for 'shuffle'. You " +"need to " +"make additional changes if you want a specific random function.";

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Mads Ravn via Phabricator via cfe-commits
madsravn added inline comments. Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:30 +" The old user defined 'RandomFunction' is not usable for 'shuffle'. You " +"need to " +"make additional changes if you want a specific random function.";

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Nice check! Thank you for working on this! Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:30 +" The old user defined 'RandomFunction' is not usable for 'shuffle'. You " +"need to " +"make additional changes if you want a

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-19 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/ReleaseNotes.rst:78 + + Finds and fixes usage of random_shuffle as the function has been removed from C++17. + Please add std:: and enclose random_shuffle in ``. Comment at:

[PATCH] D30158: [clang-tidy] modernize: Find usage of random_shuffle and replace it with shuffle.

2017-02-19 Thread Mads Ravn via Phabricator via cfe-commits
madsravn created this revision. Herald added subscribers: JDevlieghere, mgorny. random_shuffle was deprecated by C++14 and will be removed by C++17. This check will find and replace usage of random_shuffle with its modern counterpart (shuffle). https://reviews.llvm.org/D30158 Files: