[PATCH] Random Number Generator Refactoring (removing from Module)

Stephen Crane sjcrane at uci.edu
Tue Jul 8 12:29:19 PDT 2014

Thanks for all the feedback on the comments. Was a bit rushed when I wrote those I guess, but I'll definitely fix those up now.

Comment at: include/llvm/Support/RandomNumberGenerator.h:42
@@ -41,3 +41,3 @@
   /// Returns a random number in the range [0, Max).
-  uint64_t next(uint64_t Max);
+  uint_fast64_t operator()();
JF Bastien wrote:
> Why the change to uint_fast64_t? Seems odd with the rest of the codebase not using it, but I guess there's no harm either.
This was simply because that's what the MT RNG returns. It could probably be safely cast to something more common.

Comment at: lib/Support/RandomNumberGenerator.cpp:41
@@ +40,3 @@
+  // might be problematic if the input filename extension changes
+  // (e.g. from .c to .bc or .ll).
+  //
JF Bastien wrote:
> I'm not sure that's actually a problem.
Me either. I was hoping to get some feedback from anyone who thought it might be. @nlewycky, do you have an opinion?


More information about the llvm-commits mailing list