mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This adds a new copy of LLVMSupport into the runtime. This is the final step before changing the inline namespace for the runtime support. This will allow us to avoid the ODR violations from the header definitions of LLVMSupport. LLVMSupport forked at: 22492eead218ec91d349c8c50439880fbeacf2b7 Changes made to LLVMSupport from that revision: process.inc forward declares `_beginthreadex` due to compilation issues due to custom flag handling API changes required that we alter the `Deallocate` routine to account for the alignment. This is a temporary state, meant to simplify the process. We do not use the entire LLVMSupport library and there is no value in keeping the entire library. Subsequent commits will prune the library to the needs for the runtime.
29 lines
1.2 KiB
C++
29 lines
1.2 KiB
C++
//===-------------- lib/Support/Hashing.cpp -------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file provides implementation bits for the LLVM common hashing
|
|
// infrastructure. Documentation and most of the other information is in the
|
|
// header file.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/ADT/Hashing.h"
|
|
|
|
using namespace llvm;
|
|
|
|
// Provide a definition and static initializer for the fixed seed. This
|
|
// initializer should always be zero to ensure its value can never appear to be
|
|
// non-zero, even during dynamic initialization.
|
|
uint64_t llvm::hashing::detail::fixed_seed_override = 0;
|
|
|
|
// Implement the function for forced setting of the fixed seed.
|
|
// FIXME: Use atomic operations here so that there is no data race.
|
|
void llvm::set_fixed_execution_hash_seed(uint64_t fixed_value) {
|
|
hashing::detail::fixed_seed_override = fixed_value;
|
|
}
|