9#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H
10#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H
23class SymbolVisitorDelegate;
28 Mapping(Reader, Container) {}
42 if (
auto EC = S.visitKnownRecord(Symbol,
Record))
50 if (
auto EC = deserializeAs<T>(Symbol,
Record))
57 : Delegate(Delegate), Container(Container) {}
64 assert(!Mapping &&
"Already in a symbol mapping!");
65 Mapping = std::make_unique<MappingInfo>(
Record.content(), Container);
66 return Mapping->Mapping.visitSymbolBegin(
Record);
69 assert(Mapping &&
"Not in a symbol mapping!");
70 auto EC = Mapping->Mapping.visitSymbolEnd(
Record);
75#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
76 Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \
77 return visitKnownRecordImpl(CVR, Record); \
79#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
80#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
83 template <
typename T> Error visitKnownRecordImpl(
CVSymbol &CVR,
T &Record) {
87 if (
auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))
92 SymbolVisitorDelegate *Delegate;
94 std::unique_ptr<MappingInfo> Mapping;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.
Provides read only access to a subclass of BinaryStream.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Error visitSymbolBegin(CVSymbol &Record) override
static Error deserializeAs(CVSymbol Symbol, T &Record)
SymbolDeserializer(SymbolVisitorDelegate *Delegate, CodeViewContainer Container)
Error visitSymbolEnd(CVSymbol &Record) override
Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override
Paired begin/end actions for all symbols.
static Expected< T > deserializeAs(CVSymbol Symbol)
virtual uint32_t getRecordOffset(BinaryStreamReader Reader)=0
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section.
CVRecord< SymbolKind > CVSymbol
This is an optimization pass for GlobalISel generic memory operations.