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

Unified Diff: src/IceRNG.h

Issue 455593004: Subzero: Add a random number generator. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 6 years, 4 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/IceGlobalContext.cpp ('k') | src/IceRNG.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRNG.h
diff --git a/src/IceRNG.h b/src/IceRNG.h
new file mode 100644
index 0000000000000000000000000000000000000000..423aee00e233110a5aeb783ffcda8ba07661781a
--- /dev/null
+++ b/src/IceRNG.h
@@ -0,0 +1,33 @@
+//===- subzero/src/IceRNG.h - Random number generator -----------*- C++ -*-===//
+//
+// The Subzero Code Generator
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares a random number generator.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUBZERO_SRC_ICERNG_H
+#define SUBZERO_SRC_ICERNG_H
+
+#include <stdint.h>
+#include "llvm/ADT/StringRef.h"
+
+namespace Ice {
+
+class RandomNumberGenerator {
+public:
+ RandomNumberGenerator(llvm::StringRef Salt);
+ uint64_t next(uint64_t Max);
+
+private:
+ uint64_t State;
+};
+
+} // end of namespace Ice
+
+#endif // SUBZERO_SRC_ICERNG_H
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceRNG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698