Index: llvm/include/llvm/Support/DJB.h =================================================================== --- llvm/include/llvm/Support/DJB.h +++ llvm/include/llvm/Support/DJB.h @@ -18,10 +18,10 @@ namespace llvm { /// The Bernstein hash function used by the DWARF accelerator tables. -inline uint32_t djbHash(StringRef Buffer, uint32_t H = 5381) { +inline uint32_t djbHash(StringRef Buffer, uint64_t H = 5381) { for (unsigned char C : Buffer.bytes()) - H = (H << 5) + H + C; - return H; + H = ((H & 0xFFFFFFFF) << 5) + H + C; + return static_cast(H); } /// Computes the Bernstein hash after folding the input according to the Dwarf 5