Nicolas Capens | 0cf2006 | 2016-09-26 15:02:51 -0400 | [diff] [blame^] | 1 | //===-------------- lib/Support/Hashing.cpp -------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file provides implementation bits for the LLVM common hashing |
| 11 | // infrastructure. Documentation and most of the other information is in the |
| 12 | // header file. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "llvm/ADT/Hashing.h" |
| 17 | |
| 18 | using namespace llvm; |
| 19 | |
| 20 | // Provide a definition and static initializer for the fixed seed. This |
| 21 | // initializer should always be zero to ensure its value can never appear to be |
| 22 | // non-zero, even during dynamic initialization. |
| 23 | size_t llvm::hashing::detail::fixed_seed_override = 0; |
| 24 | |
| 25 | // Implement the function for forced setting of the fixed seed. |
| 26 | // FIXME: Use atomic operations here so that there is no data race. |
| 27 | void llvm::set_fixed_execution_hash_seed(size_t fixed_value) { |
| 28 | hashing::detail::fixed_seed_override = fixed_value; |
| 29 | } |