summaryrefslogtreecommitdiffstats
path: root/llvm/lib/BinaryFormat/Dwarf.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-01-24 16:53:14 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-01-24 16:53:14 +0000
commit5803a6744e0623ca72bcb9d0535ef7fd0e3b8163 (patch)
treecb6923cf780a60e93ac219ea3ab95f8fc8bbff0d /llvm/lib/BinaryFormat/Dwarf.cpp
parentd5a56e48b9993629e85029750ba7cf1020bc96d5 (diff)
downloadbcm5719-llvm-5803a6744e0623ca72bcb9d0535ef7fd0e3b8163.tar.gz
bcm5719-llvm-5803a6744e0623ca72bcb9d0535ef7fd0e3b8163.zip
[NFC] Make magic number for DJB hash function customizable.
This allows us to specify the magic number for the DJB hash function. This feature is needed by dsymutil to emit Apple types accelerator table. llvm-svn: 323341
Diffstat (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Dwarf.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp
index 593ce7a1965..74f86a84a98 100644
--- a/llvm/lib/BinaryFormat/Dwarf.cpp
+++ b/llvm/lib/BinaryFormat/Dwarf.cpp
@@ -587,8 +587,7 @@ bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version,
return ExtensionsOk;
}
-uint32_t llvm::dwarf::djbHash(StringRef Buffer) {
- uint32_t H = 5381;
+uint32_t llvm::dwarf::djbHash(StringRef Buffer, uint32_t H) {
for (char C : Buffer.bytes())
H = ((H << 5) + H) + C;
return H;
OpenPOWER on IntegriCloud