summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/RandomNumberGenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* llvm-ar: Fix MinGW compilationHans Wennborg2020-02-281-1/+1
| | | | | | | | | | | | | | | | llvm-ar is using CompareStringOrdinal which is available only starting with Windows Vista (WINVER 0x600). Fix this by hoising WindowsSupport.h, which sets _WIN32_WINNT to 0x0601, up to llvm/include/llvm/Support and use it in llvm-ar. Patch by Cristian Adam! Differential revision: https://reviews.llvm.org/D74599 (cherry picked from commit 01f9abbb50b11dd26b9ccb7cb565cc955d2b9c74) This is for https://bugs.llvm.org/show_bug.cgi?id=44907
* [CommandLine] Provide parser<unsigned long> instantiation to allow ↵Fangrui Song2019-04-241-7/+3
| | | | | | | | | | | | | cl::opt<uint64_t> on LP64 platforms Summary: And migrate opt<unsigned long long> to opt<uint64_t> Fixes PR19665 Differential Revision: https://reviews.llvm.org/D60933 llvm-svn: 359068
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Use llvm::copy. NFCFangrui Song2018-11-171-1/+1
| | | | llvm-svn: 347126
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-4/+2
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-2/+2
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* Mark all library options as hidden.Zachary Turner2017-12-011-2/+2
| | | | | | | | | | | | | | | | | These command line options are not intended for public use, and often don't even make sense in the context of a particular tool anyway. About 90% of them are already hidden, but when people add new options they forget to hide them, so if you were to make a brand new tool today, link against one of LLVM's libraries, and run tool -help you would get a bunch of junk that doesn't make sense for the tool you're writing. This patch hides these options. The real solution is to not have libraries defining command line options, but that's a much larger effort and not something I'm prepared to take on. Differential Revision: https://reviews.llvm.org/D40674 llvm-svn: 319505
* [Support] Fix undefined behavior in RandomNumberGenerator.Zachary Turner2016-10-111-4/+4
| | | | | | | | | This has existed pretty much forever AFAICT, but the code was never being exercised because nobody was using the class. A user of this class surfaced, and now we're breaking with UB. The code was obviously wrong, so it's fixed here. llvm-svn: 283912
* Make RandomNumberGenerator compatible with <random>Mehdi Amini2016-10-111-1/+1
| | | | | | | | | | | | | LLVM's RandomNumberGenerator wasn't compatible with the random distribution from <random>. Fixes PR25105 Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D25443 llvm-svn: 283854
* Implement getRandomBytes() functionEugene Leviant2016-08-261-0/+34
| | | | | | | | | This function allows getting arbitrary sized block of random bytes. Primary motivation is support for --build-id=uuid in lld. Differential revision: https://reviews.llvm.org/D23671 llvm-svn: 279807
* Add missing include that MSVC complains about.Benjamin Kramer2015-03-231-2/+4
| | | | | | Also reorder includes a bit, NFC. llvm-svn: 232980
* Random Number Generator Refactoring (removing from Module)JF Bastien2014-12-171-18/+12
| | | | | | | | | | This patch removes the RNG from Module. Passes should instead create a new RNG for their use as needed. Patch by Stephen Crane @rinon. Differential revision: http://reviews.llvm.org/D4377 llvm-svn: 224444
* Random Number Generator (llvm)JF Bastien2014-06-251-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Provides an abstraction for a random number generator (RNG) that produces a stream of pseudo-random numbers. The current implementation uses C++11 facilities and is therefore not cryptographically secure. The RNG is salted with the text of the current command line invocation. In addition, a user may specify a seed (reproducible builds). In clang, the seed can be set via -frandom-seed=X In the back end, the seed can be set via -rng-seed=X This is the llvm part of the patch. clang part: D3391 URL: http://reviews.llvm.org/D3390 Author: yln I'm landing this for the second time, it broke Windows bots the first time around. llvm-svn: 211705
* Revert "Random Number Generator (llvm)"JF Bastien2014-06-181-52/+0
| | | | | | | | This reverts commit cccba093090d127e0b6d17473b14c264c14c5259. It causes build breakage. llvm-svn: 211146
* Random Number Generator (llvm)JF Bastien2014-06-181-0/+52
Summary: Provides an abstraction for a random number generator (RNG) that produces a stream of pseudo-random numbers. The current implementation uses C++11 facilities and is therefore not cryptographically secure. The RNG is salted with the text of the current command line invocation. In addition, a user may specify a seed (reproducible builds). In clang, the seed can be set via -frandom-seed=X In the back end, the seed can be set via -rng-seed=X This is the llvm part of the patch. clang part: D3391 Reviewers: ahomescu, rinon, nicholas, jfb Reviewed By: jfb Subscribers: jfb, perl Differential Revision: http://reviews.llvm.org/D3390 llvm-svn: 211145
OpenPOWER on IntegriCloud