Chromium Code Reviews| Index: src/IceGlobalContext.cpp | 
| diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp | 
| index 5dd8b6306ec89c6a8eaa1c62c5785b7363020556..56d025c6c2726ad82c7346b5d6d94347bd978898 100644 | 
| --- a/src/IceGlobalContext.cpp | 
| +++ b/src/IceGlobalContext.cpp | 
| @@ -15,6 +15,8 @@ | 
| #include <ctype.h> // isdigit(), isupper() | 
| #include <locale> // locale | 
| +#include "llvm/Support/CommandLine.h" | 
| + | 
| #include "IceDefs.h" | 
| #include "IceTypes.h" | 
| #include "IceCfg.h" | 
| @@ -24,6 +26,14 @@ | 
| namespace Ice { | 
| +namespace { | 
| +namespace cl = llvm::cl; | 
| + | 
| +cl::opt<uint64_t> RandomSeed("random-seed", | 
| + cl::desc("Seed the random number generator"), | 
| + cl::init(1)); | 
| 
 
Jim Stichnoth
2014/08/08 05:05:38
Can you default initialize to time(0) or something
 
wala
2014/08/08 16:36:13
Done.
 
 | 
| +} // end anonymous namespace | 
| + | 
| // TypePool maps constants of type KeyType (e.g. float) to pointers to | 
| // type ValueType (e.g. ConstantFloat). KeyType values are compared | 
| // using memcmp() because of potential NaN values in KeyType values. | 
| @@ -119,7 +129,8 @@ GlobalContext::GlobalContext(llvm::raw_ostream *OsDump, | 
| IceString TestPrefix) | 
| : StrDump(OsDump), StrEmit(OsEmit), VMask(Mask), | 
| ConstPool(new ConstantPool()), Arch(Arch), Opt(Opt), | 
| - TestPrefix(TestPrefix), HasEmittedFirstMethod(false) {} | 
| + TestPrefix(TestPrefix), HasEmittedFirstMethod(false), | 
| + RNG(RandomSeed) {} | 
| // Scan a string for S[0-9A-Z]*_ patterns and replace them with | 
| // S<num>_ where <num> is the next base-36 value. If a type name |