9#ifndef LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_SYMBOLCACHE_H
29struct FileChecksumEntry;
35class PDBSymbolCompiland;
47 mutable std::vector<std::unique_ptr<NativeRawSymbol>> Cache;
57 FieldListMembersToSymbolId;
61 mutable std::vector<SymIndexId> Compilands;
64 mutable std::vector<std::unique_ptr<NativeSourceFile>> SourceFiles;
80 SymTabOffsetToSymbolId;
82 struct LineTableEntry {
90 std::vector<LineTableEntry> findLineTable(
uint16_t Modi)
const;
95 Cache.push_back(
nullptr);
99 template <
typename ConcreteSymbolT,
typename CVRecordT,
typename... Args>
101 Args &&...ConstructorArgs)
const {
104 codeview::TypeDeserializer::deserializeAs<CVRecordT>(CVT,
Record)) {
109 return createSymbol<ConcreteSymbolT>(
110 TI, std::move(
Record), std::forward<Args>(ConstructorArgs)...);
119 std::unique_ptr<PDBSymbol> findFunctionSymbolBySectOffset(
uint32_t Sect,
121 std::unique_ptr<PDBSymbol> findPublicSymbolBySectOffset(
uint32_t Sect,
127 template <
typename ConcreteSymbolT,
typename... Args>
133 auto Result = std::make_unique<ConcreteSymbolT>(
134 Session, Id, std::forward<Args>(ConstructorArgs)...);
135 Result->SymbolId = Id;
138 Cache.push_back(std::move(Result));
146 LLVM_ABI std::unique_ptr<IPDBEnumSymbols>
149 LLVM_ABI std::unique_ptr<IPDBEnumSymbols>
152 LLVM_ABI std::unique_ptr<IPDBEnumSymbols>
157 template <
typename ConcreteSymbolT,
typename... Args>
160 Args &&... ConstructorArgs) {
162 std::pair<codeview::TypeIndex, uint32_t> Key{FieldListTI,
Index};
163 auto Result = FieldListMembersToSymbolId.
try_emplace(Key, SymId);
166 createSymbol<ConcreteSymbolT>(std::forward<Args>(ConstructorArgs)...);
168 SymId = Result.first->second;
181 LLVM_ABI std::unique_ptr<IPDBEnumLineNumbers>
184 LLVM_ABI std::unique_ptr<PDBSymbolCompiland>
192 template <
typename ConcreteT>
197 LLVM_ABI std::unique_ptr<IPDBSourceFile>
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.
LLVM_ABI std::unique_ptr< IPDBEnumSymbols > createGlobalsEnumerator(codeview::SymbolKind Kind)
LLVM_ABI 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)
LLVM_ABI std::unique_ptr< IPDBEnumSymbols > createTypeEnumerator(codeview::TypeLeafKind Kind)
LLVM_ABI std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
LLVM_ABI SymIndexId getOrCreateSourceFile(const codeview::FileChecksumEntry &Checksum) const
LLVM_ABI SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const
LLVM_ABI NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
ConcreteT & getNativeSymbolById(SymIndexId SymbolId) const
LLVM_ABI std::unique_ptr< PDBSymbolCompiland > getOrCreateCompiland(uint32_t Index)
LLVM_ABI uint32_t getNumCompilands() const
LLVM_ABI std::unique_ptr< IPDBSourceFile > getSourceFileById(SymIndexId FileId) const
LLVM_ABI std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByVA(uint64_t VA, uint32_t Length) const
SymIndexId createSymbol(Args &&...ConstructorArgs) const
LLVM_ABI std::unique_ptr< PDBSymbol > findSymbolBySectOffset(uint32_t Sect, uint32_t Offset, PDB_SymType Type)
LLVM_ABI 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.