This is an archive of the discontinued LLVM Phabricator instance.

Remove uses of `std::random_shuffle` in the llvm code base
ClosedPublic

Authored by mclow.lists on Feb 9 2017, 11:58 AM.

Details

Summary

std::random_shuffle has been deprecated since C++14, and will be removed in C++17. The replacement is std::shuffle. Change all of the remaining uses (outside of libc++) to use std::shuffle.

The rationale for doing this in the standard is here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190

I'd appreciate some feedback on the changes in ListReducer.h; I matched what was there, but was not 100% sure of the intent.

Diff Detail

Event Timeline

mclow.lists created this revision.Feb 9 2017, 11:58 AM
vsk accepted this revision.Feb 15 2017, 4:33 PM
vsk added a subscriber: vsk.

LGTM, but please drop the extra whitespace introduced by the patch. Your ListReducer.h looks fine, since the intent appears to be to use a fixed random seed.

This revision is now accepted and ready to land.Feb 15 2017, 4:33 PM
mclow.lists closed this revision.Feb 16 2017, 6:48 AM

Committed as revision 295325