mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Do not serialize unstable hashes
https://github.com/llvm/llvm-project/pull/96282 changed `get_execution_seed` to be non-deterministic. Use stable hashes instead.
This commit is contained in:
@@ -1116,7 +1116,7 @@ namespace {
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(key_type_ref key) {
|
||||
return llvm::DenseMapInfo<SerializedSwiftName>::getHashValue(key);
|
||||
return static_cast<hash_value_type>(key.Kind) + llvm::djbHash(key.Name);
|
||||
}
|
||||
|
||||
std::pair<unsigned, unsigned> EmitKeyDataLength(raw_ostream &out,
|
||||
@@ -1223,7 +1223,8 @@ namespace {
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(key_type_ref key) {
|
||||
return static_cast<unsigned>(key.first) + llvm::djbHash(key.second);
|
||||
return static_cast<hash_value_type>(key.first) +
|
||||
llvm::djbHash(key.second);
|
||||
}
|
||||
|
||||
std::pair<unsigned, unsigned> EmitKeyDataLength(raw_ostream &out,
|
||||
@@ -1414,7 +1415,7 @@ namespace {
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return llvm::DenseMapInfo<SerializedSwiftName>::getHashValue(key);
|
||||
return static_cast<hash_value_type>(key.Kind) + llvm::djbHash(key.Name);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
@@ -1502,7 +1503,7 @@ namespace {
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return static_cast<unsigned>(key.first) + llvm::djbHash(key.second);
|
||||
return static_cast<hash_value_type>(key.first) + llvm::djbHash(key.second);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
|
||||
Reference in New Issue
Block a user