134085df4SChandler Carruth //===-------------- lib/Support/Hashing.cpp -------------------------------===// 234085df4SChandler Carruth // 3*2946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*2946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 5*2946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 634085df4SChandler Carruth // 734085df4SChandler Carruth //===----------------------------------------------------------------------===// 834085df4SChandler Carruth // 934085df4SChandler Carruth // This file provides implementation bits for the LLVM common hashing 1034085df4SChandler Carruth // infrastructure. Documentation and most of the other information is in the 1134085df4SChandler Carruth // header file. 1234085df4SChandler Carruth // 1334085df4SChandler Carruth //===----------------------------------------------------------------------===// 1434085df4SChandler Carruth 1534085df4SChandler Carruth #include "llvm/ADT/Hashing.h" 1634085df4SChandler Carruth 1734085df4SChandler Carruth using namespace llvm; 1834085df4SChandler Carruth 1934085df4SChandler Carruth // Provide a definition and static initializer for the fixed seed. This 2034085df4SChandler Carruth // initializer should always be zero to ensure its value can never appear to be 2134085df4SChandler Carruth // non-zero, even during dynamic initialization. 22c0445098STim Northover uint64_t llvm::hashing::detail::fixed_seed_override = 0; 2334085df4SChandler Carruth 2434085df4SChandler Carruth // Implement the function for forced setting of the fixed seed. 2534085df4SChandler Carruth // FIXME: Use atomic operations here so that there is no data race. set_fixed_execution_hash_seed(uint64_t fixed_value)26c0445098STim Northovervoid llvm::set_fixed_execution_hash_seed(uint64_t fixed_value) { 2734085df4SChandler Carruth hashing::detail::fixed_seed_override = fixed_value; 2834085df4SChandler Carruth } 29