Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: src/IceRNG.cpp

Issue 1024203002: Move some flag-like props from GlobalContext and TargetLowering to ClFlags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review / clean up formatting Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceRNG.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRNG.cpp
diff --git a/src/IceRNG.cpp b/src/IceRNG.cpp
index 03171ad432f3fab5736971fac8cec3a4720bcb34..43c7f07de7969e3cab78f3c632315eda336b0586 100644
--- a/src/IceRNG.cpp
+++ b/src/IceRNG.cpp
@@ -13,24 +13,12 @@
#include <time.h>
-#include "llvm/Support/CommandLine.h"
-
#include "IceRNG.h"
namespace Ice {
namespace {
-namespace cl = llvm::cl;
-
-// TODO(stichnot): See if we can easily use LLVM's -rng-seed option
-// and implementation. I expect the implementation is different and
-// therefore the tests would need to be changed.
-cl::opt<unsigned long long>
- RandomSeed("sz-seed", cl::desc("Seed the random number generator"),
- cl::init(time(0)));
-
const unsigned MAX = 2147483647;
-
} // end of anonymous namespace
// TODO(wala,stichnot): Switch to RNG implementation from LLVM or C++11.
@@ -39,8 +27,8 @@ const unsigned MAX = 2147483647;
// subsequent run, for reproducing a bug. Print the seed in a comment
// in the asm output. Embed the seed in the binary via metadata that an
// attacker can't introspect.
-RandomNumberGenerator::RandomNumberGenerator(llvm::StringRef)
- : State(RandomSeed) {}
+RandomNumberGenerator::RandomNumberGenerator(uint64_t Seed, llvm::StringRef)
+ : State(Seed) {}
uint64_t RandomNumberGenerator::next(uint64_t Max) {
// Lewis, Goodman, and Miller (1969)
« no previous file with comments | « src/IceRNG.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698