LLVM 19.0.0git
PDBStringTableBuilder.h
Go to the documentation of this file.
1//===- PDBStringTableBuilder.h - PDB String Table Builder -------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file creates the "/names" stream.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLEBUILDER_H
14#define LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLEBUILDER_H
15
16#include "llvm/ADT/StringRef.h"
18#include "llvm/Support/Error.h"
19#include <cstdint>
20
21namespace llvm {
22class BinaryStreamWriter;
23class WritableBinaryStreamRef;
24
25namespace msf {
26struct MSFLayout;
27}
28
29namespace pdb {
30
31class PDBFileBuilder;
32class PDBStringTableBuilder;
33
36
41};
42
44public:
45 // If string S does not exist in the string table, insert it.
46 // Returns the ID for S.
48
51
53 Error commit(BinaryStreamWriter &Writer) const;
54
56
57private:
58 uint32_t calculateHashTableSize() const;
59 Error writeHeader(BinaryStreamWriter &Writer) const;
60 Error writeStrings(BinaryStreamWriter &Writer) const;
61 Error writeHashTable(BinaryStreamWriter &Writer) const;
62 Error writeEpilogue(BinaryStreamWriter &Writer) const;
63
65};
66
67} // end namespace pdb
68} // end namespace llvm
69
70#endif // LLVM_DEBUGINFO_PDB_NATIVE_PDBSTRINGTABLEBUILDER_H
Provides write only access to a subclass of WritableBinaryStream.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Represents a read-write view of a CodeView string table.
void setStrings(const codeview::DebugStringTableSubsection &Strings)
Error commit(BinaryStreamWriter &Writer) const
StringRef getStringForId(uint32_t Id) const
uint32_t getIdForString(StringRef S) const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
uint32_t hashLookupKey(StringRef S) const
StringRef storageKeyToLookupKey(uint32_t Offset) const