diff options
Diffstat (limited to 'llvm/tools/bugpoint/FindBugs.cpp')
| -rw-r--r-- | llvm/tools/bugpoint/FindBugs.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/FindBugs.cpp b/llvm/tools/bugpoint/FindBugs.cpp index 156f4d0d78f..3093169ba8b 100644 --- a/llvm/tools/bugpoint/FindBugs.cpp +++ b/llvm/tools/bugpoint/FindBugs.cpp @@ -21,6 +21,7 @@ #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <ctime> +#include <random> using namespace llvm; Error @@ -39,14 +40,13 @@ BugDriver::runManyPasses(const std::vector<std::string> &AllPasses) { return E; } - srand(time(nullptr)); - + std::mt19937 randomness(std::random_device{}()); unsigned num = 1; while (1) { // // Step 1: Randomize the order of the optimizer passes. // - std::random_shuffle(PassesToRun.begin(), PassesToRun.end()); + std::shuffle(PassesToRun.begin(), PassesToRun.end(), randomness); // // Step 2: Run optimizer passes on the program and check for success. |

