Skip to content

Force the DJB hash seed to 0 for compatibility with HashString. #14890

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

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

adrian-prantl
Copy link
Contributor

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.

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.
@adrian-prantl adrian-prantl merged commit d0e0bff into swiftlang:master-next Feb 28, 2018
@JDevlieghere
Copy link
Contributor

LGTM. I did the same thing in LLVM where the seed affected the tests.

@bob-wilson
Copy link
Contributor

What about the apinotes code in swift-clang's upstream-with-swift branch? Should those also use seed=0? Did you file a JIRA bug report to track the FIXME's here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants