10 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H 11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDESERIALIZER_H 24 class SymbolVisitorDelegate;
29 Mapping(Reader, Container) {}
43 if (
auto EC = S.visitKnownRecord(Symbol, Record))
50 T Record(static_cast<SymbolRecordKind>(Symbol.
kind()));
51 if (
auto EC = deserializeAs<T>(Symbol, Record))
58 : Delegate(Delegate), Container(Container) {}
65 assert(!Mapping &&
"Already in a symbol mapping!");
66 Mapping = llvm::make_unique<MappingInfo>(Record.
content(), Container);
67 return Mapping->Mapping.visitSymbolBegin(Record);
70 assert(Mapping &&
"Not in a symbol mapping!");
71 auto EC = Mapping->Mapping.visitSymbolEnd(Record);
76 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \ 77 Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \ 78 return visitKnownRecordImpl(CVR, Record); \ 80 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) 81 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def" 84 template <
typename T> Error visitKnownRecordImpl(
CVSymbol &CVR,
T &Record) {
87 Delegate ? Delegate->getRecordOffset(Mapping->Reader) : 0;
88 if (
auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))
93 SymbolVisitorDelegate *Delegate;
95 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.
static Error deserializeAs(CVSymbol Symbol, T &Record)