LLVM 20.0.0git
NamedStreamMap.h
Go to the documentation of this file.
1//===- NamedStreamMap.h - PDB Named Stream Map ------------------*- 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#ifndef LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
11
12#include "llvm/ADT/StringMap.h"
13#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Error.h"
16#include <cstdint>
17
18namespace llvm {
19
20class BinaryStreamReader;
21class BinaryStreamWriter;
22
23namespace pdb {
24
25class NamedStreamMap;
26
29
34};
35
38
39public:
41
43 Error commit(BinaryStreamWriter &Writer) const;
45
46 uint32_t size() const;
47 bool get(StringRef Stream, uint32_t &StreamNo) const;
48 void set(StringRef Stream, uint32_t StreamNo);
49
53
55
56private:
57 NamedStreamMapTraits HashTraits;
58 /// Closed hash table from Offset -> StreamNumber, where Offset is the offset
59 /// of the stream name in NamesBuffer.
61
62 /// Buffer of string data.
63 std::vector<char> NamesBuffer;
64};
65
66} // end namespace pdb
67
68} // end namespace llvm
69
70#endif // LLVM_DEBUGINFO_PDB_NATIVE_NAMEDSTREAMMAP_H
This file defines the StringMap class.
AMDGPU Mark last scratch load
Provides read only access to a subclass of BinaryStream.
Provides write only access to a subclass of WritableBinaryStream.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:128
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
void set(StringRef Stream, uint32_t StreamNo)
StringMap< uint32_t > entries() const
Error commit(BinaryStreamWriter &Writer) const
uint32_t hashString(uint32_t Offset) const
uint32_t appendStringData(StringRef S)
bool get(StringRef Stream, uint32_t &StreamNo) const
StringRef getString(uint32_t Offset) const
friend class NamedStreamMapBuilder
uint32_t calculateSerializedLength() const
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
uint16_t hashLookupKey(StringRef S) const
uint32_t lookupKeyToStorageKey(StringRef S)
StringRef storageKeyToLookupKey(uint32_t Offset) const