diff options
Diffstat (limited to 'llvm/lib/Support/Process.cpp')
-rw-r--r-- | llvm/lib/Support/Process.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index 88ca7c3f220..c65cb454046 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -22,6 +22,15 @@ using namespace sys; //=== independent code. //===----------------------------------------------------------------------===// +unsigned llvm::sys::Process::GetRandomNumber() { +#if defined(HAVE_ARC4RANDOM) + return arc4random(); +#else + static int x = (::srand(::time(NULL)), 0); + return rand(); +#endif +} + } // Include the platform-specific parts of this class. |