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

Stephen Crane sjcrane at uci.edu
Wed Aug 20 16:29:10 PDT 2014


================
Comment at: include/llvm/IR/Module.h:266
@@ -263,1 +265,3 @@
+  /// versions when the pass does not change.
+  RandomNumberGenerator *createRNG(StringRef PassSalt) const;
 
----------------
JF Bastien wrote:
> I'm still wondering if it would be better for this API to take in a `const Pass *` and use `P->getName()` as the Pass salt. This makes it easier to use the RNG correctly, since Pass authors don't need to think about the Pass salt, the same way they don't need to think about the Module salt. LLVM's RegisterPass takes in a PassName argument, so all passes should already have a name (avoiding duplicate salt issues).
You make a great point. I wasn't aware that all passes actually set a PassName (I must confess I've written too many that hook in strangely and don't override getName...). I'll change this right now.

http://reviews.llvm.org/D4377






More information about the llvm-commits mailing list