LLVM 24.0.0git
SymbolCache.cpp
Go to the documentation of this file.
2
40
41using namespace llvm;
42using namespace llvm::codeview;
43using namespace llvm::pdb;
44
45// Maps codeview::SimpleTypeKind of a built-in type to the parameters necessary
46// to instantiate a NativeBuiltinSymbol for that type.
74 // This table can be grown as necessary, but these are the only types we've
75 // needed so far.
76};
77
79 : Session(Session), Dbi(Dbi), AddressToSymbolId(IMapAllocator) {
80 // Id 0 is reserved for the invalid symbol.
81 Cache.push_back(nullptr);
82 SourceFiles.push_back(nullptr);
83
84 if (Dbi)
85 Compilands.resize(Dbi->modules().getModuleCount());
86}
87
88std::unique_ptr<IPDBEnumSymbols>
90 return createTypeEnumerator(std::vector<TypeLeafKind>{Kind});
91}
92
93std::unique_ptr<IPDBEnumSymbols>
94SymbolCache::createTypeEnumerator(std::vector<TypeLeafKind> Kinds) {
95 auto Tpi = Session.getPDBFile().getPDBTpiStream();
96 if (!Tpi) {
97 consumeError(Tpi.takeError());
98 return nullptr;
99 }
100 auto &Types = Tpi->typeCollection();
101 return std::unique_ptr<IPDBEnumSymbols>(
102 new NativeEnumTypes(Session, Types, std::move(Kinds)));
103}
104
105std::unique_ptr<IPDBEnumSymbols>
107 return std::unique_ptr<IPDBEnumSymbols>(
108 new NativeEnumGlobals(Session, {Kind}));
109}
110
111SymIndexId SymbolCache::createSimpleType(TypeIndex Index,
112 ModifierOptions Mods) const {
113 if (Index.getSimpleMode() != codeview::SimpleTypeMode::Direct)
115
116 const auto Kind = Index.getSimpleKind();
117 const auto It =
118 llvm::find_if(BuiltinTypes, [Kind](const BuiltinTypeEntry &Builtin) {
119 return Builtin.Kind == Kind;
120 });
121 if (It == std::end(BuiltinTypes))
122 return 0;
123 return createSymbol<NativeTypeBuiltin>(Mods, It->Type, It->Size);
124}
125
127SymbolCache::createSymbolForModifiedType(codeview::TypeIndex ModifierTI,
128 codeview::CVType CVT) const {
131 consumeError(std::move(EC));
132 return 0;
133 }
134
135 if (Record.ModifiedType.isSimple())
136 return createSimpleType(Record.ModifiedType, Record.Modifiers);
137
138 // Make sure we create and cache a record for the unmodified type.
139 SymIndexId UnmodifiedId = findSymbolByTypeIndex(Record.ModifiedType);
140 NativeRawSymbol &UnmodifiedNRS = *Cache[UnmodifiedId];
141
142 switch (UnmodifiedNRS.getSymTag()) {
145 static_cast<NativeTypeEnum &>(UnmodifiedNRS), std::move(Record));
146 case PDB_SymType::UDT:
148 static_cast<NativeTypeUDT &>(UnmodifiedNRS), std::move(Record));
149 default:
150 // No other types can be modified. (LF_POINTER, for example, records
151 // its modifiers a different way.
152 assert(false && "Invalid LF_MODIFIER record");
153 break;
154 }
155 return 0;
156}
157
159 // First see if it's already in our cache.
160 const auto Entry = TypeIndexToSymbolId.find(Index);
161 if (Entry != TypeIndexToSymbolId.end())
162 return Entry->second;
163
164 // Symbols for built-in types are created on the fly.
165 if (Index.isSimple()) {
166 SymIndexId Result = createSimpleType(Index, ModifierOptions::None);
167 assert(TypeIndexToSymbolId.count(Index) == 0);
168 TypeIndexToSymbolId[Index] = Result;
169 return Result;
170 }
171
172 // We need to instantiate and cache the desired type symbol.
173 auto Tpi = Session.getPDBFile().getPDBTpiStream();
174 if (!Tpi) {
175 consumeError(Tpi.takeError());
176 return 0;
177 }
178 codeview::LazyRandomTypeCollection &Types = Tpi->typeCollection();
179 codeview::CVType CVT = Types.getType(Index);
180
181 if (isUdtForwardRef(CVT)) {
182 Expected<TypeIndex> EFD = Tpi->findFullDeclForForwardRef(Index);
183
184 if (!EFD)
185 consumeError(EFD.takeError());
186 else if (*EFD != Index) {
187 assert(!isUdtForwardRef(Types.getType(*EFD)));
188 SymIndexId Result = findSymbolByTypeIndex(*EFD);
189 // Record a mapping from ForwardRef -> SymIndex of complete type so that
190 // we'll take the fast path next time.
191 assert(TypeIndexToSymbolId.count(Index) == 0);
192 TypeIndexToSymbolId[Index] = Result;
193 return Result;
194 }
195 }
196
197 // At this point if we still have a forward ref udt it means the full decl was
198 // not in the PDB. We just have to deal with it and use the forward ref.
199 SymIndexId Id = 0;
200 switch (CVT.kind()) {
201 case codeview::LF_ENUM:
202 Id = createSymbolForType<NativeTypeEnum, EnumRecord>(Index, std::move(CVT));
203 break;
204 case codeview::LF_ARRAY:
205 Id = createSymbolForType<NativeTypeArray, ArrayRecord>(Index,
206 std::move(CVT));
207 break;
208 case codeview::LF_CLASS:
209 case codeview::LF_CLASS2:
210 case codeview::LF_STRUCTURE:
211 case codeview::LF_STRUCTURE2:
212 case codeview::LF_INTERFACE:
213 case codeview::LF_INTERFACE2:
214 Id = createSymbolForType<NativeTypeUDT, ClassRecord>(Index, std::move(CVT));
215 break;
216 case codeview::LF_UNION:
217 case codeview::LF_UNION2:
218 Id = createSymbolForType<NativeTypeUDT, UnionRecord>(Index, std::move(CVT));
219 break;
220 case codeview::LF_POINTER:
221 Id = createSymbolForType<NativeTypePointer, PointerRecord>(Index,
222 std::move(CVT));
223 break;
224 case codeview::LF_MODIFIER:
225 Id = createSymbolForModifiedType(Index, std::move(CVT));
226 break;
227 case codeview::LF_PROCEDURE:
228 Id = createSymbolForType<NativeTypeFunctionSig, ProcedureRecord>(
229 Index, std::move(CVT));
230 break;
231 case codeview::LF_MFUNCTION:
232 Id = createSymbolForType<NativeTypeFunctionSig, MemberFunctionRecord>(
233 Index, std::move(CVT));
234 break;
235 case codeview::LF_VTSHAPE:
236 Id = createSymbolForType<NativeTypeVTShape, VFTableShapeRecord>(
237 Index, std::move(CVT));
238 break;
239 default:
240 Id = createSymbolPlaceholder();
241 break;
242 }
243 if (Id != 0) {
244 assert(TypeIndexToSymbolId.count(Index) == 0);
245 TypeIndexToSymbolId[Index] = Id;
246 }
247 return Id;
248}
249
250std::unique_ptr<PDBSymbol>
252 assert(SymbolId < Cache.size());
253
254 // Id 0 is reserved.
255 if (SymbolId == 0 || SymbolId >= Cache.size())
256 return nullptr;
257
258 // Make sure to handle the case where we've inserted a placeholder symbol
259 // for types we don't yet support.
260 NativeRawSymbol *NRS = Cache[SymbolId].get();
261 if (!NRS)
262 return nullptr;
263
264 return PDBSymbol::create(Session, *NRS);
265}
266
268 return *Cache[SymbolId];
269}
270
272 if (!Dbi)
273 return 0;
274
275 return Dbi->modules().getModuleCount();
276}
277
279 auto Iter = GlobalOffsetToSymbolId.find(Offset);
280 if (Iter != GlobalOffsetToSymbolId.end())
281 return Iter->second;
282
283 SymbolStream &SS = cantFail(Session.getPDBFile().getPDBSymbolStream());
284 CVSymbol CVS = SS.readRecord(Offset);
285 SymIndexId Id = 0;
286 switch (CVS.kind()) {
287 case SymbolKind::S_UDT: {
289 Id = createSymbol<NativeTypeTypedef>(std::move(US));
290 break;
291 }
292 default:
293 Id = createSymbolPlaceholder();
294 break;
295 }
296 if (Id != 0) {
297 assert(GlobalOffsetToSymbolId.count(Offset) == 0);
298 GlobalOffsetToSymbolId[Offset] = Id;
299 }
300
301 return Id;
302}
303
305 uint64_t ParentAddr,
306 uint16_t Modi,
307 uint32_t RecordOffset) const {
308 auto Iter = SymTabOffsetToSymbolId.find({Modi, RecordOffset});
309 if (Iter != SymTabOffsetToSymbolId.end())
310 return Iter->second;
311
313 SymTabOffsetToSymbolId.insert({{Modi, RecordOffset}, Id});
314 return Id;
315}
316
317std::unique_ptr<PDBSymbol> SymbolCache::findSymbolByVA(uint64_t VA,
319 switch (Type) {
321 return findFunctionSymbolByVA(VA);
323 uint32_t Sect, Offset;
324 Session.addressForVA(VA, Sect, Offset);
325 return findPublicSymbolBySectOffset(Sect, Offset);
326 }
328 uint16_t Modi;
329 if (!Session.moduleIndexForVA(VA, Modi))
330 return nullptr;
331 return getOrCreateCompiland(Modi);
332 }
333 case PDB_SymType::None: {
334 // FIXME: Implement for PDB_SymType::Data. The symbolizer calls this but
335 // only uses it to find the symbol length.
336 if (auto Sym = findFunctionSymbolByVA(VA))
337 return Sym;
338 return nullptr;
339 }
340 default:
341 return nullptr;
342 }
343}
344
345std::unique_ptr<PDBSymbol> SymbolCache::findFunctionSymbolByVA(uint64_t VA) {
346 if (!Dbi)
347 return nullptr;
348
349 auto findIdInCache = [this](uint64_t VA) -> SymIndexId {
350 auto Iter = AddressToSymbolId.find(VA);
351 if (Iter.valid() && !IMapTy::KeyTraits::startLess(VA, Iter.start()))
352 return *Iter;
353 return 0;
354 };
355
356 if (SymIndexId Id = findIdInCache(VA))
357 return getSymbolById(Id);
358
359 uint16_t Modi;
360 if (!Session.moduleIndexForVA(VA, Modi))
361 return nullptr;
362
363 // Module has already been decoded and no cached symbols found.
364 if (!FuncSymCachedModIndexes.insert(Modi).second)
365 return nullptr;
366
367 Expected<ModuleDebugStreamRef> ExpectedModS =
368 Session.getModuleDebugStream(Modi);
369 if (!ExpectedModS) {
370 consumeError(ExpectedModS.takeError());
371 return nullptr;
372 }
373
374 // Return empty intervals in AddressToSymbolId from Start to Stop.
375 auto getInsertRanges = [this](uint64_t Start, uint64_t Stop) {
377 auto Iter = AddressToSymbolId.find(Start);
378 while (Iter.valid() && IMapTy::KeyTraits::nonEmpty(Start, Stop)) {
379 if (IMapTy::KeyTraits::startLess(Start, Iter.start()))
380 Ranges.push_back({Start, std::min(Iter.start(), Stop)});
381
382 // Same result as Start = std::min(Stop, Iter.stop()).
383 Start = Iter.stop();
384 ++Iter;
385 }
386 if (IMapTy::KeyTraits::nonEmpty(Start, Stop))
387 Ranges.push_back({Start, Stop});
388
389 return Ranges;
390 };
391
392 // Decode symbols in this module.
393 CVSymbolArray Syms = ExpectedModS->getSymbolArray();
394 for (auto I = Syms.begin(), E = Syms.end(); I != E; ++I) {
395 if (I->kind() != S_LPROC32 && I->kind() != S_GPROC32)
396 continue;
397
399 uint64_t SymStart = Session.getVAFromSectOffset(PS.Segment, PS.CodeOffset);
400 uint64_t SymStop = SymStart + PS.CodeSize;
401 if (LLVM_UNLIKELY(!IMapTy::KeyTraits::nonEmpty(SymStart, SymStop))) {
402 I = Syms.at(PS.End);
403 continue;
404 }
405#ifndef NDEBUG
406 Session.checkSymbolRange(SymStart, SymStop);
407#endif
408 // Only care about range that is in this module.
409 uint16_t SymModi;
410 if (!Session.moduleIndexForVA(SymStart, SymModi) || SymModi != Modi)
411 continue;
412
413 auto Ranges = getInsertRanges(SymStart, SymStop);
414 if (!Ranges.empty()) {
416 for (auto [Start, Stop] : Ranges)
417 AddressToSymbolId.insert(Start, Stop, Id);
418 }
419
420 // Jump to the end of this ProcSym.
421 I = Syms.at(PS.End);
422 }
423
424 if (SymIndexId Id = findIdInCache(VA))
425 return getSymbolById(Id);
426
427 return nullptr;
428}
429
430std::unique_ptr<PDBSymbol>
431SymbolCache::findPublicSymbolBySectOffset(uint32_t Sect, uint32_t Offset) {
432 auto Iter = AddressToPublicSymId.find({Sect, Offset});
433 if (Iter != AddressToPublicSymId.end())
434 return getSymbolById(Iter->second);
435
436 auto Publics = Session.getPDBFile().getPDBPublicsStream();
437 if (!Publics) {
438 consumeError(Publics.takeError());
439 return nullptr;
440 }
441
442 auto ExpectedSyms = Session.getPDBFile().getPDBSymbolStream();
443 if (!ExpectedSyms) {
444 consumeError(ExpectedSyms.takeError());
445 return nullptr;
446 }
447 BinaryStreamRef SymStream =
448 ExpectedSyms->getSymbolArray().getUnderlyingStream();
449
450 // Use binary search to find the first public symbol with an address greater
451 // than or equal to Sect, Offset.
452 auto AddrMap = Publics->getAddressMap();
453 auto First = AddrMap.begin();
454 auto It = AddrMap.begin();
455 size_t Count = AddrMap.size();
456 size_t Half;
457 while (Count > 0) {
458 It = First;
459 Half = Count / 2;
460 It += Half;
461 Expected<CVSymbol> Sym = readSymbolFromStream(SymStream, *It);
462 if (!Sym) {
463 consumeError(Sym.takeError());
464 return nullptr;
465 }
466
467 auto PS =
469 if (PS.Segment < Sect || (PS.Segment == Sect && PS.Offset <= Offset)) {
470 First = ++It;
471 Count -= Half + 1;
472 } else
473 Count = Half;
474 }
475 if (It == AddrMap.begin())
476 return nullptr;
477 --It;
478
479 Expected<CVSymbol> Sym = readSymbolFromStream(SymStream, *It);
480 if (!Sym) {
481 consumeError(Sym.takeError());
482 return nullptr;
483 }
484
485 // Check if the symbol is already cached.
487 auto Found = AddressToPublicSymId.find({PS.Segment, PS.Offset});
488 if (Found != AddressToPublicSymId.end())
489 return getSymbolById(Found->second);
490
491 // Otherwise, create a new symbol.
493 AddressToPublicSymId.insert({{PS.Segment, PS.Offset}, Id});
494 return getSymbolById(Id);
495}
496
497std::vector<SymbolCache::LineTableEntry>
498SymbolCache::findLineTable(uint16_t Modi) const {
499 // Check if this module has already been added.
500 auto [LineTableIter, Inserted] = LineTable.try_emplace(Modi);
501 if (!Inserted)
502 return LineTableIter->second;
503
504 std::vector<LineTableEntry> &ModuleLineTable = LineTableIter->second;
505
506 // If there is an error or there are no lines, just return the
507 // empty vector.
508 Expected<ModuleDebugStreamRef> ExpectedModS =
509 Session.getModuleDebugStream(Modi);
510 if (!ExpectedModS) {
511 consumeError(ExpectedModS.takeError());
512 return ModuleLineTable;
513 }
514
515 std::vector<std::vector<LineTableEntry>> EntryList;
516 for (const auto &SS : ExpectedModS->getSubsectionsArray()) {
517 if (SS.kind() != DebugSubsectionKind::Lines)
518 continue;
519
520 DebugLinesSubsectionRef Lines;
521 BinaryStreamReader Reader(SS.getRecordData());
522 if (auto EC = Lines.initialize(Reader)) {
523 consumeError(std::move(EC));
524 continue;
525 }
526
527 uint32_t RelocSegment = Lines.header()->RelocSegment;
528 uint32_t RelocOffset = Lines.header()->RelocOffset;
529 for (const LineColumnEntry &Group : Lines) {
530 if (Group.LineNumbers.empty())
531 continue;
532
533 std::vector<LineTableEntry> Entries;
534
535 // If there are column numbers, then they should be in a parallel stream
536 // to the line numbers.
537 auto ColIt = Group.Columns.begin();
538 auto ColsEnd = Group.Columns.end();
539
540 // Add a line to mark the beginning of this section.
541 uint64_t StartAddr =
542 Session.getVAFromSectOffset(RelocSegment, RelocOffset);
543 LineInfo FirstLine(Group.LineNumbers.front().Flags);
544 uint32_t ColNum =
545 (Lines.hasColumnInfo()) ? Group.Columns.front().StartColumn : 0;
546 Entries.push_back({StartAddr, FirstLine, ColNum, Group.NameIndex, false});
547
548 for (const LineNumberEntry &LN : Group.LineNumbers) {
549 uint64_t VA =
550 Session.getVAFromSectOffset(RelocSegment, RelocOffset + LN.Offset);
551 LineInfo Line(LN.Flags);
552 ColNum = 0;
553
554 if (Lines.hasColumnInfo() && ColIt != ColsEnd) {
555 ColNum = ColIt->StartColumn;
556 ++ColIt;
557 }
558 Entries.push_back({VA, Line, ColNum, Group.NameIndex, false});
559 }
560
561 // Add a terminal entry line to mark the end of this subsection.
562 uint64_t EndAddr = StartAddr + Lines.header()->CodeSize;
563 LineInfo LastLine(Group.LineNumbers.back().Flags);
564 ColNum = (Lines.hasColumnInfo()) ? Group.Columns.back().StartColumn : 0;
565 Entries.push_back({EndAddr, LastLine, ColNum, Group.NameIndex, true});
566
567 EntryList.push_back(Entries);
568 }
569 }
570
571 // Sort EntryList, and add flattened contents to the line table.
572 llvm::sort(EntryList, [](const std::vector<LineTableEntry> &LHS,
573 const std::vector<LineTableEntry> &RHS) {
574 return LHS[0].Addr < RHS[0].Addr;
575 });
576 for (std::vector<LineTableEntry> &I : EntryList)
577 llvm::append_range(ModuleLineTable, I);
578
579 return ModuleLineTable;
580}
581
582std::unique_ptr<IPDBEnumLineNumbers>
584 uint16_t Modi;
585 if (!Session.moduleIndexForVA(VA, Modi))
586 return nullptr;
587
588 std::vector<LineTableEntry> Lines = findLineTable(Modi);
589 if (Lines.empty())
590 return nullptr;
591
592 // Find the first line in the line table whose address is not greater than
593 // the one we are searching for.
594 auto LineIter = llvm::partition_point(Lines, [&](const LineTableEntry &E) {
595 return (E.Addr < VA || (E.Addr == VA && E.IsTerminalEntry));
596 });
597
598 // Try to back up if we've gone too far.
599 if (LineIter == Lines.end() || LineIter->Addr > VA) {
600 if (LineIter == Lines.begin() || std::prev(LineIter)->IsTerminalEntry)
601 return nullptr;
602 --LineIter;
603 }
604
605 Expected<ModuleDebugStreamRef> ExpectedModS =
606 Session.getModuleDebugStream(Modi);
607 if (!ExpectedModS) {
608 consumeError(ExpectedModS.takeError());
609 return nullptr;
610 }
611 Expected<DebugChecksumsSubsectionRef> ExpectedChecksums =
612 ExpectedModS->findChecksumsSubsection();
613 if (!ExpectedChecksums) {
614 consumeError(ExpectedChecksums.takeError());
615 return nullptr;
616 }
617
618 // Populate a vector of NativeLineNumbers that have addresses in the given
619 // address range.
620 std::vector<NativeLineNumber> LineNumbers;
621 while (LineIter != Lines.end()) {
622 if (LineIter->IsTerminalEntry) {
623 ++LineIter;
624 continue;
625 }
626
627 // If the line is still within the address range, create a NativeLineNumber
628 // and add to the list.
629 if (LineIter->Addr > VA + Length)
630 break;
631
632 uint32_t LineSect, LineOff;
633 Session.addressForVA(LineIter->Addr, LineSect, LineOff);
634 uint32_t LineLength = std::next(LineIter)->Addr - LineIter->Addr;
635 auto ChecksumIter =
636 ExpectedChecksums->getArray().at(LineIter->FileNameIndex);
637 uint32_t SrcFileId = getOrCreateSourceFile(*ChecksumIter);
638 NativeLineNumber LineNum(Session, LineIter->Line, LineIter->ColumnNumber,
639 LineSect, LineOff, LineLength, SrcFileId, Modi);
640 LineNumbers.push_back(LineNum);
641 ++LineIter;
642 }
643 return std::make_unique<NativeEnumLineNumbers>(std::move(LineNumbers));
644}
645
646std::unique_ptr<PDBSymbolCompiland>
648 if (!Dbi)
649 return nullptr;
650
651 if (Index >= Compilands.size())
652 return nullptr;
653
654 if (Compilands[Index] == 0) {
655 const DbiModuleList &Modules = Dbi->modules();
656 Compilands[Index] =
658 }
659
660 return Session.getConcreteSymbolById<PDBSymbolCompiland>(Compilands[Index]);
661}
662
663std::unique_ptr<IPDBSourceFile>
665 assert(FileId < SourceFiles.size());
666
667 // Id 0 is reserved.
668 if (FileId == 0)
669 return nullptr;
670
671 return std::make_unique<NativeSourceFile>(*SourceFiles[FileId].get());
672}
673
676 auto [Iter, Inserted] =
677 FileNameOffsetToId.try_emplace(Checksums.FileNameOffset);
678 if (!Inserted)
679 return Iter->second;
680
681 SymIndexId Id = SourceFiles.size();
682 auto SrcFile = std::make_unique<NativeSourceFile>(Session, Id, Checksums);
683 SourceFiles.push_back(std::move(SrcFile));
684 Iter->second = Id;
685 return Id;
686}
687
688
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
unsigned uint64_t
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_UNLIKELY(EXPR)
Definition Compiler.h:352
#define I(x, y, z)
Definition MD5.cpp:57
static const struct BuiltinTypeEntry BuiltinTypes[]
Value * RHS
Value * LHS
Tagged union holding either a T or a Error.
Definition Error.h:485
Error takeError()
Take ownership of the stored error.
Definition Error.h:612
reference get()
Returns a reference to the stored T value.
Definition Error.h:582
const_iterator find(KeyT x) const
find - Return an iterator pointing to the first interval ending at or after x, or end().
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Iterator at(uint32_t Offset) const
given an offset into the array's underlying stream, return an iterator to the record at that offset.
Iterator begin(bool *HadError=nullptr) const
Provides amortized O(1) random access to a CodeView type stream.
static Error deserializeAs(CVSymbol Symbol, T &Record)
static Error deserializeAs(CVType &CVT, T &Record)
A 32-bit type reference.
Definition TypeIndex.h:97
std::pair< iterator, bool > insert(const ValueT &V)
Definition DenseSet.h:209
LLVM_ABI DbiModuleDescriptor getModuleDescriptor(uint32_t Modi) const
PDB_SymType getSymTag() const override
Expected< ModuleDebugStreamRef > getModuleDebugStream(uint32_t Index) const
bool moduleIndexForVA(uint64_t VA, uint16_t &ModuleIndex) const
static std::unique_ptr< PDBSymbol > create(const IPDBSession &PDBSession, std::unique_ptr< IPDBRawSymbol > RawSymbol)
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
LLVM_ABI std::unique_ptr< IPDBEnumSymbols > createTypeEnumerator(codeview::TypeLeafKind Kind)
LLVM_ABI std::unique_ptr< PDBSymbol > findSymbolByVA(uint64_t VA, PDB_SymType Type)
LLVM_ABI std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
LLVM_ABI SymbolCache(NativeSession &Session, DbiStream *Dbi)
LLVM_ABI SymIndexId getOrCreateSourceFile(const codeview::FileChecksumEntry &Checksum) const
LLVM_ABI SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const
LLVM_ABI NativeRawSymbol & 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 SymIndexId getOrCreateGlobalSymbolByOffset(uint32_t Offset)
LLVM_ABI bool isUdtForwardRef(CVType CVT)
Given an arbitrary codeview type, determine if it is an LF_STRUCTURE, LF_CLASS, LF_INTERFACE,...
CVRecord< TypeLeafKind > CVType
Definition CVRecord.h:64
VarStreamArray< CVSymbol > CVSymbolArray
Definition CVRecord.h:126
CVRecord< SymbolKind > CVSymbol
Definition CVRecord.h:65
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
Definition CodeView.h:34
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition CodeView.h:48
ModifierOptions
Equivalent to CV_modifier_t.
Definition CodeView.h:285
LLVM_ABI Expected< CVSymbol > readSymbolFromStream(BinaryStreamRef Stream, uint32_t Offset)
uint32_t SymIndexId
Definition PDBTypes.h:26
PDB_BuiltinType
These values correspond to the Basictype enumeration, and are documented here: https://msdn....
Definition PDBTypes.h:335
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
Definition PDBTypes.h:243
This is an optimization pass for GlobalISel generic memory operations.
@ Length
Definition DWP.cpp:577
auto partition_point(R &&Range, Predicate P)
Binary search for the first iterator in a range where a predicate is false.
Definition STLExtras.h:2145
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Definition STLExtras.h:2224
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void sort(IteratorTy Start, IteratorTy End)
Definition STLExtras.h:1652
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
Definition ModRef.h:74
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition Error.h:769
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
Definition InstrProf.h:145
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1788
void consumeError(Error Err)
Consume a Error without doing anything.
Definition Error.h:1106
codeview::SimpleTypeKind Kind
PDB_BuiltinType Type