diff options
Diffstat (limited to 'llvm/lib/BinaryFormat/Dwarf.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/Dwarf.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp index 37c4579ef0f..86e3b02577f 100644 --- a/llvm/lib/BinaryFormat/Dwarf.cpp +++ b/llvm/lib/BinaryFormat/Dwarf.cpp @@ -575,3 +575,10 @@ bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version, } return ExtensionsOk; } + +uint32_t llvm::dwarf::djbHash(StringRef Buffer) { + uint32_t H = 5381; + for (char C : Buffer.bytes()) + H = ((H << 5) + H) + C; + return H; +} |