//===-- Support/DJB.cpp ---DJB Hash -----------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains support for the DJ Bernstein hash function. // //===----------------------------------------------------------------------===// #include "llvm/Support/DJB.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/Unicode.h" usingnamespacellvm; static UTF32 chopOneUTF32(StringRef &Buffer) { … } static StringRef toUTF8(UTF32 C, MutableArrayRef<UTF8> Storage) { … } static UTF32 foldCharDwarf(UTF32 C) { … } static std::optional<uint32_t> fastCaseFoldingDjbHash(StringRef Buffer, uint32_t H) { … } uint32_t llvm::caseFoldingDjbHash(StringRef Buffer, uint32_t H) { … }