9#ifndef LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
28struct FileChecksumEntry;
34class PDBSymbolCompiland;
46 mutable std::vector<std::unique_ptr<NativeRawSymbol>> Cache;
56 FieldListMembersToSymbolId;
60 mutable std::vector<SymIndexId> Compilands;
63 mutable std::vector<std::unique_ptr<NativeSourceFile>> SourceFiles;
79 SymTabOffsetToSymbolId;
81 struct LineTableEntry {
89 std::vector<LineTableEntry> findLineTable(
uint16_t Modi)
const;
94 Cache.push_back(
nullptr);
98 template <
typename ConcreteSymbolT,
typename CVRecordT,
typename... Args>
100 Args &&...ConstructorArgs)
const {
103 codeview::TypeDeserializer::deserializeAs<CVRecordT>(CVT,
Record)) {
108 return createSymbol<ConcreteSymbolT>(
109 TI, std::move(
Record), std::forward<Args>(ConstructorArgs)...);
118 std::unique_ptr<PDBSymbol> findFunctionSymbolBySectOffset(
uint32_t Sect,
120 std::unique_ptr<PDBSymbol> findPublicSymbolBySectOffset(
uint32_t Sect,
126 template <
typename ConcreteSymbolT,
typename... Args>
132 auto Result = std::make_unique<ConcreteSymbolT>(
133 Session, Id, std::forward<Args>(ConstructorArgs)...);
134 Result->SymbolId = Id;
137 Cache.push_back(std::move(Result));
145 std::unique_ptr<IPDBEnumSymbols>
148 std::unique_ptr<IPDBEnumSymbols>
151 std::unique_ptr<IPDBEnumSymbols>
156 template <
typename ConcreteSymbolT,
typename... Args>
159 Args &&... ConstructorArgs) {
161 std::pair<codeview::TypeIndex, uint32_t> Key{FieldListTI,
Index};
162 auto Result = FieldListMembersToSymbolId.
try_emplace(Key, SymId);
165 createSymbol<ConcreteSymbolT>(std::forward<Args>(ConstructorArgs)...);
167 SymId = Result.first->second;
176 std::unique_ptr<PDBSymbol>
179 std::unique_ptr<IPDBEnumLineNumbers>
189 template <
typename ConcreteT>
This file defines the DenseMap class.
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
The instances of the Type class are immutable: once they are created, they are never changed.
std::unique_ptr< IPDBEnumSymbols > createGlobalsEnumerator(codeview::SymbolKind Kind)
SymIndexId getOrCreateInlineSymbol(codeview::InlineSiteSym Sym, uint64_t ParentAddr, uint16_t Modi, uint32_t RecordOffset) const
SymIndexId getOrCreateFieldListMember(codeview::TypeIndex FieldListTI, uint32_t Index, Args &&... ConstructorArgs)
std::unique_ptr< IPDBEnumSymbols > createTypeEnumerator(codeview::TypeLeafKind Kind)
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
SymIndexId getOrCreateSourceFile(const codeview::FileChecksumEntry &Checksum) const
SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
ConcreteT & getNativeSymbolById(SymIndexId SymbolId) const
std::unique_ptr< PDBSymbolCompiland > getOrCreateCompiland(uint32_t Index)
uint32_t getNumCompilands() const
std::unique_ptr< IPDBSourceFile > getSourceFileById(SymIndexId FileId) const
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByVA(uint64_t VA, uint32_t Length) const
SymIndexId createSymbol(Args &&...ConstructorArgs) const
std::unique_ptr< PDBSymbol > findSymbolBySectOffset(uint32_t Sect, uint32_t Offset, PDB_SymType Type)
SymIndexId getOrCreateGlobalSymbolByOffset(uint32_t Offset)
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
ModifierOptions
Equivalent to CV_modifier_t.
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
This is an optimization pass for GlobalISel generic memory operations.
void consumeError(Error Err)
Consume a Error without doing anything.