[PATCH] D16487: Use std::piecewise_constant_distribution instead of ad-hoc binary search.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 14:20:57 PST 2016


kcc accepted this revision.
kcc added a comment.
This revision is now accepted and ready to land.

LGTM with nits


================
Comment at: lib/Fuzzer/FuzzerInternal.h:204
@@ -202,3 +203,3 @@
   Fuzzer(UserSuppliedFuzzer &USF, FuzzingOptions Options);
-  void AddToCorpus(const Unit &U) { Corpus.push_back(U); }
+  void AddToCorpus(const Unit &U) { Corpus.push_back(U); UpdateCorpusDistribution(); }
   size_t ChooseUnitIdxToMutate();
----------------
clang-format, please

================
Comment at: lib/Fuzzer/FuzzerInternal.h:287
@@ -282,1 +286,3 @@
 
+  std::mt19937 Generator;
+  std::piecewise_constant_distribution<double> CorpusDistribution;
----------------
add a FIXME note saying that ideally we should be able to use GetRand()


http://reviews.llvm.org/D16487





More information about the llvm-commits mailing list