9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H 10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H 23 class SymbolVisitorDelegate;
28 Mapping(Reader, Container) {}
42 if (
auto EC = S.visitKnownRecord(Symbol, Record))
49 T Record(static_cast<SymbolRecordKind>(Symbol.
kind()));
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) {
86 Delegate ? Delegate->getRecordOffset(Mapping->Reader) : 0;
87 if (
auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))
92 SymbolVisitorDelegate *Delegate;
94 std::unique_ptr<MappingInfo> Mapping;
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer...
This class represents lattice values for constants.
CVRecord< SymbolKind > CVSymbol
ArrayRef< uint8_t > content() const
Tagged union holding either a T or a Error.
SymbolDeserializer(SymbolVisitorDelegate *Delegate, CodeViewContainer Container)
static ErrorSuccess success()
Create a success value.
Error visitSymbolEnd(CVSymbol &Record) override
Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override
Paired begin/end actions for all symbols.
Error visitSymbolBegin(CVSymbol &Record) override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
static Expected< T > deserializeAs(CVSymbol Symbol)
Provides read only access to a subclass of BinaryStream.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
static Error deserializeAs(CVSymbol Symbol, T &Record)