Hashing.cpp 1.2 KB

12345678910111213141516171819202122232425262728
  1. //===-------------- lib/Support/Hashing.cpp -------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file provides implementation bits for the LLVM common hashing
  10. // infrastructure. Documentation and most of the other information is in the
  11. // header file.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "llvm/ADT/Hashing.h"
  15. using namespace llvm;
  16. // Provide a definition and static initializer for the fixed seed. This
  17. // initializer should always be zero to ensure its value can never appear to be
  18. // non-zero, even during dynamic initialization.
  19. uint64_t llvm::hashing::detail::fixed_seed_override = 0;
  20. // Implement the function for forced setting of the fixed seed.
  21. // FIXME: Use atomic operations here so that there is no data race.
  22. void llvm::set_fixed_execution_hash_seed(uint64_t fixed_value) {
  23. hashing::detail::fixed_seed_override = fixed_value;
  24. }