diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-02-26 11:30:13 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-02-26 11:30:13 +0000 |
commit | b9ad17593511a6ea513c237bd4efd760c9fb762b (patch) | |
tree | 7ad47c3bc9e83216580843c7e5f0552187f482e8 /lld/include/lld | |
parent | b84e158df7ff87d16141d798a47de3dc430036df (diff) | |
download | bcm5719-llvm-b9ad17593511a6ea513c237bd4efd760c9fb762b.tar.gz bcm5719-llvm-b9ad17593511a6ea513c237bd4efd760c9fb762b.zip |
[Support] Replace HashString with djbHash.
This removes the HashString function from StringExtraces and replaces
its uses with calls to djbHash from DJB.h
This is *almost* NFC. While the algorithm is identical, the djbHash
implementation in StringExtras used 0 as its seed while the
implementation in DJB uses 5381. The latter has been shown to result in
less collisions and improved avalanching.
https://reviews.llvm.org/D43615
(cherry picked from commit 77f7f965bc9499a9ae768a296ca5a1f7347d1d2c)
llvm-svn: 326081
Diffstat (limited to 'lld/include/lld')
-rw-r--r-- | lld/include/lld/Core/SymbolTable.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/include/lld/Core/SymbolTable.h b/lld/include/lld/Core/SymbolTable.h index 9c39a6ed507..cc2309a9068 100644 --- a/lld/include/lld/Core/SymbolTable.h +++ b/lld/include/lld/Core/SymbolTable.h @@ -12,7 +12,7 @@ #include "lld/Common/LLVM.h" #include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/StringExtras.h" +#include "llvm/Support/DJB.h" #include <cstring> #include <map> #include <vector> @@ -65,7 +65,7 @@ private: static StringRef getEmptyKey() { return StringRef(); } static StringRef getTombstoneKey() { return StringRef(" ", 1); } static unsigned getHashValue(StringRef const val) { - return llvm::HashString(val); + return llvm::djbHash(val); } static bool isEqual(StringRef const lhs, StringRef const rhs) { return lhs.equals(rhs); |