forked from OSchip/llvm-project
Use shuffle instead of random_shuffle
Summary: random_shuffle is deprecated in C++14. (cherry picked from FBD21698180)
This commit is contained in:
parent
8a680745dd
commit
2b65b3aa6b
|
@ -15,8 +15,9 @@
|
||||||
#include "BinaryBasicBlock.h"
|
#include "BinaryBasicBlock.h"
|
||||||
#include "BinaryFunction.h"
|
#include "BinaryFunction.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include <queue>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <queue>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
#undef DEBUG_TYPE
|
#undef DEBUG_TYPE
|
||||||
#define DEBUG_TYPE "bolt"
|
#define DEBUG_TYPE "bolt"
|
||||||
|
@ -720,8 +721,8 @@ void RandomClusterReorderAlgorithm::reorderBasicBlocks(
|
||||||
if (!Clusters[I].empty())
|
if (!Clusters[I].empty())
|
||||||
ClusterOrder.push_back(I);
|
ClusterOrder.push_back(I);
|
||||||
|
|
||||||
std::srand(opts::RandomSeed);
|
std::shuffle(std::next(ClusterOrder.begin()), ClusterOrder.end(),
|
||||||
std::random_shuffle(std::next(ClusterOrder.begin()), ClusterOrder.end());
|
std::default_random_engine(opts::RandomSeed.getValue()));
|
||||||
|
|
||||||
if (opts::PrintClusters) {
|
if (opts::PrintClusters) {
|
||||||
errs() << "New cluster order: ";
|
errs() << "New cluster order: ";
|
||||||
|
|
Loading…
Reference in New Issue