22 : Callbacks(Callbacks) {}
29 if (
auto EC = Callbacks.visitKnownRecord(
Record, KnownRecord))
41#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
43 if (auto EC = visitKnownRecord<Name>(Record, Callbacks)) \
47#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \
48 SYMBOL_RECORD(EnumVal, EnumVal, AliasName)
49#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
83 InitialOffset +=
I.length();
93 uint32_t ParentRecurseDepth =
Filter.ParentRecursiveDepth.value_or(0);
94 uint32_t ChildrenRecurseDepth =
Filter.ChildRecursiveDepth.value_or(0);
95 if (!
Symbols.isOffsetValid(SymbolOffset))
101 std::vector<uint32_t> ParentOffsets;
102 std::vector<uint32_t> ParentEndOffsets;
106 uint32_t BeginOffset = Begin.offset();
108 if (BeginOffset < SymbolOffset) {
111 if (SymbolOffset < EndOffset) {
112 ParentOffsets.push_back(BeginOffset);
113 ParentEndOffsets.push_back(EndOffset);
116 }
else if (BeginOffset == SymbolOffset) {
118 if (ParentRecurseDepth >= ParentOffsets.size())
119 ParentRecurseDepth = ParentOffsets.size();
120 uint32_t StartIndex = ParentOffsets.size() - ParentRecurseDepth;
121 while (StartIndex < ParentOffsets.size()) {
122 if (!
Symbols.isOffsetValid(ParentOffsets[StartIndex]))
131 }
else if (BeginOffset <= SymEndOffset) {
132 if (ChildrenRecurseDepth) {
136 if (ChildrenDepth < ChildrenRecurseDepth ||
137 BeginOffset == SymEndOffset) {
146 if (ParentRecurseDepth && BeginOffset == ParentEndOffsets.back()) {
149 ParentEndOffsets.pop_back();
150 --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.