LLVM  14.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 
21 namespace llvm {
22 class BinaryStreamWriter;
23 class WritableBinaryStreamRef;
24 
25 namespace msf {
26 struct MSFLayout;
27 }
28 
29 namespace pdb {
30 
31 class PDBFileBuilder;
32 class PDBStringTableBuilder;
33 
36 
41 };
42 
44 public:
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 
57 private:
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
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::pdb::PDBStringTableBuilder::getStringForId
StringRef getStringForId(uint32_t Id) const
Definition: PDBStringTableBuilder.cpp:54
StringRef.h
llvm::BinaryStreamWriter
Provides write only access to a subclass of WritableBinaryStream.
Definition: BinaryStreamWriter.h:31
Error.h
llvm::codeview::DebugStringTableSubsection
Represents a read-write view of a CodeView string table.
Definition: DebugStringTableSubsection.h:56
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::pdb::StringTableHashTraits::lookupKeyToStorageKey
uint32_t lookupKeyToStorageKey(StringRef S)
Definition: PDBStringTableBuilder.cpp:42
llvm::pdb::PDBStringTableBuilder::commit
Error commit(BinaryStreamWriter &Writer) const
Definition: PDBStringTableBuilder.cpp:208
llvm::pdb::PDBStringTableBuilder::insert
uint32_t insert(StringRef S)
Definition: PDBStringTableBuilder.cpp:46
llvm::pdb::StringTableHashTraits
Definition: PDBStringTableBuilder.h:34
llvm::pdb::StringTableHashTraits::StringTableHashTraits
StringTableHashTraits(PDBStringTableBuilder &Table)
Definition: PDBStringTableBuilder.cpp:25
llvm::pdb::StringTableHashTraits::storageKeyToLookupKey
StringRef storageKeyToLookupKey(uint32_t Offset) const
Definition: PDBStringTableBuilder.cpp:38
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::pdb::PDBStringTableBuilder::getIdForString
uint32_t getIdForString(StringRef S) const
Definition: PDBStringTableBuilder.cpp:50
uint32_t
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::pdb::PDBStringTableBuilder::setStrings
void setStrings(const codeview::DebugStringTableSubsection &Strings)
Definition: PDBStringTableBuilder.cpp:148
llvm::pdb::PDBStringTableBuilder::calculateSerializedSize
uint32_t calculateSerializedSize() const
Definition: PDBStringTableBuilder.cpp:139
llvm::pdb::StringTableHashTraits::hashLookupKey
uint32_t hashLookupKey(StringRef S) const
Definition: PDBStringTableBuilder.cpp:28
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::pdb::StringTableHashTraits::Table
PDBStringTableBuilder * Table
Definition: PDBStringTableBuilder.h:35
DebugStringTableSubsection.h
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:231
llvm::pdb::PDBStringTableBuilder
Definition: PDBStringTableBuilder.h:43