1//===- NameHashTable.h - PDB Name Hash Table --------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
11#define LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
12
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/DebugInfo/CodeView/StreamArray.h"
16#include "llvm/DebugInfo/CodeView/StreamRef.h"
17#include "llvm/Support/Endian.h"
18#include "llvm/Support/Error.h"
19#include <cstdint>
20#include <vector>
21
22namespace llvm {
23namespace codeview {
24class StreamReader;
25}
26namespace pdb {
27
28class NameHashTable {
29public:
30  NameHashTable();
31
32  Error load(codeview::StreamReader &Stream);
33
34  uint32_t getNameCount() const { return NameCount; }
35  uint32_t getHashVersion() const { return HashVersion; }
36  uint32_t getSignature() const { return Signature; }
37
38  StringRef getStringForID(uint32_t ID) const;
39  uint32_t getIDForString(StringRef Str) const;
40
41  codeview::FixedStreamArray<support::ulittle32_t> name_ids() const;
42
43private:
44  codeview::StreamRef NamesBuffer;
45  codeview::FixedStreamArray<support::ulittle32_t> IDs;
46  uint32_t Signature;
47  uint32_t HashVersion;
48  uint32_t NameCount;
49};
50
51} // end namespace pdb
52} // end namespace llvm
53
54#endif // LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H
55