-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Do not serialize unstable hashes #75876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
llvm/llvm-project#96282 changed `get_execution_seed` to be non-deterministic. Use stable hashes instead.
@swift-ci please test |
@@ -71,7 +71,7 @@ class LocalizationWriterInfo { | |||
using hash_value_type = uint32_t; | |||
using offset_type = uint32_t; | |||
|
|||
hash_value_type ComputeHash(key_type_ref key) { return llvm::hash_code(key); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is a no-op - it was converting to 64 bits and then back to 32 bit. I was just here because I looked for all serialization tables 😅 . Seems worth changing since hash_code
is a Hashing.h
type.
@@ -330,7 +330,7 @@ class ModuleFileSharedCore::DeclMembersTableInfo { | |||
} | |||
|
|||
hash_value_type ComputeHash(internal_key_type key) { | |||
return llvm::hash_value(key); | |||
return key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash_value
ends up calling getHashValue
and for a uint32_t
that was just val * 37
. Happy to change it to that, to reinterpret_cast then djbHash
, or just leave it like this - let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LocalizationFormat change looks good to me!
@swift-ci please test macOS platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
llvm/llvm-project#96282 changed
get_execution_seed
to be non-deterministic. Use stable hashes instead.