//===- Hash.cpp - PDB Hash Functions --------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/PDB/Native/Hash.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/CRC.h" #include "llvm/Support/Endian.h" #include <cstdint> usingnamespacellvm; usingnamespacellvm::support; // Corresponds to `Hasher::lhashPbCb` in PDB/include/misc.h. // Used for name hash table and TPI/IPI hashes. uint32_t pdb::hashStringV1(StringRef Str) { … } // Corresponds to `HasherV2::HashULONG` in PDB/include/misc.h. // Used for name hash table. uint32_t pdb::hashStringV2(StringRef Str) { … } // Corresponds to `SigForPbCb` in langapi/shared/crc32.h. uint32_t pdb::hashBufferV8(ArrayRef<uint8_t> Buf) { … }