From 92ac9d3e1b32535062b985e5a868b16f154db6df Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Sun, 28 Jan 2018 11:05:10 +0000 Subject: [Support] Move DJB hash to support. NFC This patch moves the DJB hash to support. This is consistent with other hashing algorithms living there. The hash is used by the DWARF accelerator tables. We're doing this now because the hashing function is needed by dsymutil and we don't want to link against libBinaryFormat. Differential revision: https://reviews.llvm.org/D42594 llvm-svn: 323616 --- llvm/lib/BinaryFormat/Dwarf.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp') diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp index 0ec57870f65..169e50e8d14 100644 --- a/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/llvm/lib/BinaryFormat/Dwarf.cpp @@ -589,9 +589,3 @@ bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version, } return ExtensionsOk; } - -uint32_t llvm::dwarf::djbHash(StringRef Buffer, uint32_t H) { - for (char C : Buffer.bytes()) - H = ((H << 5) + H) + C; - return H; -} -- cgit v1.2.3