summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2019-01-31 06:52:55 +0000
committerKostya Serebryany <kcc@google.com>2019-01-31 06:52:55 +0000
commit046cac61c19e5d9c6262feb4de8df99e0a3b8248 (patch)
tree76e4a87f12fb53fa38ddad28b0c917a10c3a6802
parent08c60c1894158d37e37e965aa536dddcffdc972b (diff)
downloadbcm5719-llvm-046cac61c19e5d9c6262feb4de8df99e0a3b8248.tar.gz
bcm5719-llvm-046cac61c19e5d9c6262feb4de8df99e0a3b8248.zip
[libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand
llvm-svn: 352732
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerRandom.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerRandom.h b/compiler-rt/lib/fuzzer/FuzzerRandom.h
index f475797871c..4dde7d84d88 100644
--- a/compiler-rt/lib/fuzzer/FuzzerRandom.h
+++ b/compiler-rt/lib/fuzzer/FuzzerRandom.h
@@ -14,10 +14,10 @@
#include <random>
namespace fuzzer {
-class Random : public std::mt19937 {
+class Random : public std::minstd_rand {
public:
- Random(unsigned int seed) : std::mt19937(seed) {}
- result_type operator()() { return this->std::mt19937::operator()(); }
+ Random(unsigned int seed) : std::minstd_rand(seed) {}
+ result_type operator()() { return this->std::minstd_rand::operator()(); }
size_t Rand() { return this->operator()(); }
size_t RandBool() { return Rand() % 2; }
size_t operator()(size_t n) { return n ? Rand() % n : 0; }
OpenPOWER on IntegriCloud