aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringMap.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2021-03-01 13:58:18 +0100
committerserge-sans-paille <sguelton@redhat.com>2021-03-01 14:00:39 +0100
commit7b319df29bf4ebe690ca0c41761e46d8b0081293 (patch)
tree6e0ed2067bf5ae3a9c91c156a417408584de74cc /llvm/lib/Support/StringMap.cpp
parent7abf7dd5efe257b5e7ff72199aa513e7a513b742 (diff)
downloadllvm-7b319df29bf4ebe690ca0c41761e46d8b0081293.zip
llvm-7b319df29bf4ebe690ca0c41761e46d8b0081293.tar.gz
llvm-7b319df29bf4ebe690ca0c41761e46d8b0081293.tar.bz2
Revert "Use the default seed value for djb hash for StringMap"
This reverts commit d84440ec919019ac446241db72cfd905c6ac9dfa. It breaks (at least) lldb and lld validation https://lab.llvm.org/buildbot/#/builders/68/builds/7837 https://lab.llvm.org/buildbot/#/builders/36/builds/5495
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
-rw-r--r--llvm/lib/Support/StringMap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/StringMap.cpp b/llvm/lib/Support/StringMap.cpp
index 69a144f..f65d384 100644
--- a/llvm/lib/Support/StringMap.cpp
+++ b/llvm/lib/Support/StringMap.cpp
@@ -77,7 +77,7 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) {
init(16);
HTSize = NumBuckets;
}
- unsigned FullHashValue = djbHash(Name);
+ unsigned FullHashValue = djbHash(Name, 0);
unsigned BucketNo = FullHashValue & (HTSize - 1);
unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
@@ -133,7 +133,7 @@ int StringMapImpl::FindKey(StringRef Key) const {
unsigned HTSize = NumBuckets;
if (HTSize == 0)
return -1; // Really empty table?
- unsigned FullHashValue = djbHash(Key);
+ unsigned FullHashValue = djbHash(Key, 0);
unsigned BucketNo = FullHashValue & (HTSize - 1);
unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);