mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Force the DJB hash seed to 0 for compatibility with HashString.
The obsolete llvm::HashString() was equivalent to llvm::djbHash(seed=0) and was removed from llvm. This patch replaces all occurences of llvm::HashString() with llvm::djbHash(seed=0), no functional change. The default seed of llvm::djbHash() is supposed to yield a higher quality result that using seed=0, but changing it looks like it affects the ordering of SIL serialization.
This commit is contained in:
@@ -318,7 +318,8 @@ public:
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
if (key.first == DeclBaseName::Kind::Normal) {
|
||||
return llvm::djbHash(key.second);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key.second, 0);
|
||||
} else {
|
||||
return (hash_value_type)key.first;
|
||||
}
|
||||
@@ -380,7 +381,8 @@ public:
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return llvm::djbHash(key);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key, 0);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
@@ -438,8 +440,9 @@ public:
|
||||
return ID;
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return llvm::djbHash(key);
|
||||
hash_value_type ComputeHash(iternal_key_type key) {
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key, 0);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
@@ -476,7 +479,8 @@ public:
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return llvm::djbHash(key);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key, 0);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
@@ -531,7 +535,8 @@ public:
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
if (key.first == DeclBaseName::Kind::Normal) {
|
||||
return llvm::djbHash(key.second);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key.second, 0);
|
||||
} else {
|
||||
return (hash_value_type)key.first;
|
||||
}
|
||||
@@ -704,7 +709,8 @@ public:
|
||||
}
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
return llvm::djbHash(key);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key, 0);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
@@ -891,7 +897,8 @@ public:
|
||||
|
||||
hash_value_type ComputeHash(internal_key_type key) {
|
||||
assert(!key.empty());
|
||||
return llvm::djbHash(key);
|
||||
// FIXME: DJB seed=0, audit whether the default seed could be used.
|
||||
return llvm::djbHash(key, 0);
|
||||
}
|
||||
|
||||
static bool EqualKey(internal_key_type lhs, internal_key_type rhs) {
|
||||
|
||||
Reference in New Issue
Block a user