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))
52 : Delegate(Delegate), Container(Container) {}
59 assert(!Mapping &&
"Already in a symbol mapping!");
60 Mapping = llvm::make_unique<MappingInfo>(Record.
content(), Container);
61 return Mapping->Mapping.visitSymbolBegin(Record);
64 assert(Mapping &&
"Not in a symbol mapping!");
65 auto EC = Mapping->Mapping.visitSymbolEnd(Record);
70 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \
71 Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \
72 return visitKnownRecordImpl(CVR, Record); \
74 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
75 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
78 template <
typename T>
Error visitKnownRecordImpl(
CVSymbol &CVR,
T &Record) {
82 if (
auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))
87 SymbolVisitorDelegate *Delegate;
89 std::unique_ptr<MappingInfo> Mapping;
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer...
virtual uint32_t getRecordOffset(BinaryStreamReader Reader)=0
CVRecord< SymbolKind > CVSymbol
SymbolDeserializer(SymbolVisitorDelegate *Delegate, CodeViewContainer Container)
static ErrorSuccess success()
Create a success value.
ArrayRef< uint8_t > content() const
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.
Provides read only access to a subclass of BinaryStream.
static Error deserializeAs(CVSymbol Symbol, T &Record)