1 //===- TpiHashing.h ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_TPIHASHING_H
11 #define LLVM_DEBUGINFO_PDB_TPIHASHING_H
13 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
14 #include "llvm/Support/Error.h"
19 Expected<uint32_t> hashTypeRecord(const llvm::codeview::CVType &Type);
21 struct TagRecordHash {
22 explicit TagRecordHash(codeview::ClassRecord CR, uint32_t Full,
24 : FullRecordHash(Full), ForwardDeclHash(Forward), Class(std::move(CR)) {
28 explicit TagRecordHash(codeview::EnumRecord ER, uint32_t Full,
30 : FullRecordHash(Full), ForwardDeclHash(Forward), Enum(std::move(ER)) {
34 explicit TagRecordHash(codeview::UnionRecord UR, uint32_t Full,
36 : FullRecordHash(Full), ForwardDeclHash(Forward), Union(std::move(UR)) {
40 uint32_t FullRecordHash;
41 uint32_t ForwardDeclHash;
43 codeview::TagRecord &getRecord() {
52 llvm_unreachable("unreachable!");
57 codeview::ClassRecord Class;
58 codeview::EnumRecord Enum;
59 codeview::UnionRecord Union;
65 /// Given a CVType referring to a class, structure, union, or enum, compute
66 /// the hash of its forward decl and full decl.
67 Expected<TagRecordHash> hashTagRecord(const codeview::CVType &Type);
69 } // end namespace pdb
70 } // end namespace llvm
72 #endif // LLVM_DEBUGINFO_PDB_TPIHASHING_H