20 : Callbacks(Callbacks) {}
27 if (
auto EC = Callbacks.visitKnownRecord(
Record, KnownRecord))
39#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
41 if (auto EC = visitKnownRecord<Name>(Record, Callbacks)) \
45#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
46 SYMBOL_RECORD(EnumVal, EnumVal, AliasName)
47#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
81 InitialOffset +=
I.length();
91 uint32_t ParentRecurseDepth =
Filter.ParentRecursiveDepth.value_or(0);
92 uint32_t ChildrenRecurseDepth =
Filter.ChildRecursiveDepth.value_or(0);
93 if (!
Symbols.isOffsetValid(SymbolOffset))
99 std::vector<uint32_t> ParentOffsets;
100 std::vector<uint32_t> ParentEndOffsets;
104 uint32_t BeginOffset = Begin.offset();
106 if (BeginOffset < SymbolOffset) {
109 if (SymbolOffset < EndOffset) {
110 ParentOffsets.push_back(BeginOffset);
111 ParentEndOffsets.push_back(EndOffset);
114 }
else if (BeginOffset == SymbolOffset) {
116 if (ParentRecurseDepth >= ParentOffsets.size())
117 ParentRecurseDepth = ParentOffsets.size();
118 uint32_t StartIndex = ParentOffsets.size() - ParentRecurseDepth;
119 while (StartIndex < ParentOffsets.size()) {
120 if (!
Symbols.isOffsetValid(ParentOffsets[StartIndex]))
129 }
else if (BeginOffset <= SymEndOffset) {
130 if (ChildrenRecurseDepth) {
134 if (ChildrenDepth < ChildrenRecurseDepth ||
135 BeginOffset == SymEndOffset) {
144 if (ParentRecurseDepth && BeginOffset == ParentEndOffsets.back()) {
147 ParentEndOffsets.pop_back();
148 --ParentRecurseDepth;
Lightweight arrays that are backed by an arbitrary BinaryStream.
static Error finishVisitation(CVSymbol &Record, SymbolVisitorCallbacks &Callbacks)
static Error visitKnownRecord(CVSymbol &Record, SymbolVisitorCallbacks &Callbacks)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks)
Error visitSymbolStreamFiltered(const CVSymbolArray &Symbols, const FilterOptions &Filter)
Error visitSymbolRecord(CVSymbol &Record)
Error visitSymbolStream(const CVSymbolArray &Symbols)
virtual Error visitSymbolEnd(CVSymbol &Record)
virtual Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset)
Paired begin/end actions for all symbols.
virtual Error visitUnknownSymbol(CVSymbol &Record)
Action to take on unknown symbols. By default, they are ignored.
bool symbolEndsScope(SymbolKind Kind)
Return true if this ssymbol ends a scope.
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section.
uint32_t getScopeEndOffset(const CVSymbol &Symbol)
Given a symbol P for which symbolOpensScope(P) == true, return the corresponding end offset.
bool symbolOpensScope(SymbolKind Kind)
Return true if this symbol opens a scope.
This is an optimization pass for GlobalISel generic memory operations.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.