LLVM: lib/DebugInfo/CodeView/SymbolSerializer.cpp Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
12#include
13#include
14#include
15
16using namespace llvm;
18
22 Writer(Stream), Mapping(Writer, Container) {}
23
25 assert(!CurrentSymbol && "Already in a symbol mapping!");
26
27 Writer.setOffset(0);
28
29 if (auto EC = writeRecordPrefix(Record.kind()))
30 return EC;
31
32 CurrentSymbol = Record.kind();
33 if (auto EC = Mapping.visitSymbolBegin(Record))
34 return EC;
35
37}
38
40 assert(CurrentSymbol && "Not in a symbol mapping!");
41
42 if (auto EC = Mapping.visitSymbolEnd(Record))
43 return EC;
44
45 uint32_t RecordEnd = Writer.getOffset();
47 Writer.setOffset(0);
48 if (auto EC = Writer.writeInteger(Length))
49 return EC;
50
51 uint8_t *StableStorage = Storage.Allocate<uint8_t>(RecordEnd);
52 ::memcpy(StableStorage, &RecordBuffer[0], RecordEnd);
54 CurrentSymbol.reset();
55
57}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Error visitSymbolBegin(CVSymbol &Record) override
Definition SymbolSerializer.cpp:24
SymbolSerializer(BumpPtrAllocator &Storage, CodeViewContainer Container)
Definition SymbolSerializer.cpp:19
Error visitSymbolEnd(CVSymbol &Record) override
Definition SymbolSerializer.cpp:39
CVRecord< SymbolKind > CVSymbol
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.