-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Serialization] Use specialized decl hash function for GlobalDeclID #95730
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,7 +230,11 @@ template <> struct DenseMapInfo<clang::GlobalDeclID> { | |
} | ||
|
||
static unsigned getHashValue(const GlobalDeclID &Key) { | ||
return DenseMapInfo<DeclID>::getHashValue(Key.get()); | ||
// Our default hash algorithm for 64 bits integer may not be very good. | ||
// In GlobalDeclID's case, it is pretty common that the lower 32 bits can | ||
// be same. | ||
return DenseMapInfo<uint32_t>::getHashValue(Key.getModuleFileIndex()) ^ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
DenseMapInfo<uint32_t>::getHashValue(Key.getLocalDeclIndex()); | ||
} | ||
|
||
static bool isEqual(const GlobalDeclID &L, const GlobalDeclID &R) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.