<div dir="ltr"><div dir="ltr" class="gmail_msg">I'm trying to submit a fix but there seem to be some issues with llvm svn being down right now.</div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Fri, Dec 16, 2016 at 4:45 PM Galina Kistanova <<a href="mailto:gkistanova@gmail.com" class="gmail_msg" target="_blank">gkistanova@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hello Zachary,<br class="gmail_msg"><br class="gmail_msg">This commit added warning to some builders:<br class="gmail_msg"><br class="gmail_msg">SymbolSerializer.cpp.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library<br class="gmail_msg"><br class="gmail_msg"><a href="http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/2384" class="gmail_msg" target="_blank">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/2384</a><br class="gmail_msg"><br class="gmail_msg">Please have a look at this?<br class="gmail_msg"><br class="gmail_msg">Thanks<br class="gmail_msg"><br class="gmail_msg">Galina<br class="gmail_msg"></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Dec 16, 2016 at 2:48 PM, Zachary Turner via llvm-commits <span dir="ltr" class="gmail_msg"><<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br class="gmail_msg">
Date: Fri Dec 16 16:48:14 2016<br class="gmail_msg">
New Revision: 290000<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290000&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=290000&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."<br class="gmail_msg">
<br class="gmail_msg">
The original patch was broken due to some undefined behavior<br class="gmail_msg">
as well as warnings that were triggering -Werror.<br class="gmail_msg">
<br class="gmail_msg">
Added:<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h<br class="gmail_msg">
llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp<br class="gmail_msg">
llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp<br class="gmail_msg">
Modified:<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h<br class="gmail_msg">
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h<br class="gmail_msg">
llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br class="gmail_msg">
llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt<br class="gmail_msg">
llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp<br class="gmail_msg">
llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp<br class="gmail_msg">
llvm/trunk/lib/MC/MCCodeView.cpp<br class="gmail_msg">
llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test<br class="gmail_msg">
llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test<br class="gmail_msg">
llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h?rev=290000&r1=289999&r2=290000&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h?rev=290000&r1=289999&r2=290000&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h Fri Dec 16 16:48:14 2016<br class="gmail_msg">
@@ -535,7 +535,7 @@ enum class ThunkOrdinal : uint8_t {<br class="gmail_msg">
BranchIsland<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
-enum class TrampolineType { TrampIncremental, BranchIsland };<br class="gmail_msg">
+enum class TrampolineType : uint16_t { TrampIncremental, BranchIsland };<br class="gmail_msg">
<br class="gmail_msg">
// These values correspond to the CV_SourceChksum_t enumeration.<br class="gmail_msg">
enum class FileChecksumKind : uint8_t { None, MD5, SHA1, SHA256 };<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h?rev=290000&r1=289999&r2=290000&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h?rev=290000&r1=289999&r2=290000&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Fri Dec 16 16:48:14 2016<br class="gmail_msg">
@@ -46,6 +46,17 @@ public:<br class="gmail_msg">
<br class="gmail_msg">
uint32_t maxFieldLength() const;<br class="gmail_msg">
<br class="gmail_msg">
+ template <typename T> Error mapObject(T &Value) {<br class="gmail_msg">
+ if (isWriting())<br class="gmail_msg">
+ return Writer->writeObject(Value);<br class="gmail_msg">
+<br class="gmail_msg">
+ const T *ValuePtr;<br class="gmail_msg">
+ if (auto EC = Reader->readObject(ValuePtr))<br class="gmail_msg">
+ return EC;<br class="gmail_msg">
+ Value = *ValuePtr;<br class="gmail_msg">
+ return Error::success();<br class="gmail_msg">
+ }<br class="gmail_msg">
+<br class="gmail_msg">
template <typename T> Error mapInteger(T &Value) {<br class="gmail_msg">
if (isWriting())<br class="gmail_msg">
return Writer->writeInteger(Value);<br class="gmail_msg">
@@ -75,6 +86,8 @@ public:<br class="gmail_msg">
Error mapStringZ(StringRef &Value);<br class="gmail_msg">
Error mapGuid(StringRef &Guid);<br class="gmail_msg">
<br class="gmail_msg">
+ Error mapStringZVectorZ(std::vector<StringRef> &Value);<br class="gmail_msg">
+<br class="gmail_msg">
template <typename SizeType, typename T, typename ElementMapper><br class="gmail_msg">
Error mapVectorN(T &Items, const ElementMapper &Mapper) {<br class="gmail_msg">
SizeType Size;<br class="gmail_msg">
@@ -121,6 +134,7 @@ public:<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes);<br class="gmail_msg">
+ Error mapByteVectorTail(std::vector<uint8_t> &Bytes);<br class="gmail_msg">
<br class="gmail_msg">
Error skipPadding();<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h?rev=290000&r1=289999&r2=290000&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h?rev=290000&r1=289999&r2=290000&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h Fri Dec 16 16:48:14 2016<br class="gmail_msg">
@@ -12,6 +12,7 @@<br class="gmail_msg">
<br class="gmail_msg">
#include "llvm/ADT/ArrayRef.h"<br class="gmail_msg">
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"<br class="gmail_msg">
+#include "llvm/DebugInfo/CodeView/SymbolRecordMapping.h"<br class="gmail_msg">
#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"<br class="gmail_msg">
#include "llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h"<br class="gmail_msg">
#include "llvm/DebugInfo/MSF/ByteStream.h"<br class="gmail_msg">
@@ -22,41 +23,50 @@ namespace llvm {<br class="gmail_msg">
namespace codeview {<br class="gmail_msg">
class SymbolVisitorDelegate;<br class="gmail_msg">
class SymbolDeserializer : public SymbolVisitorCallbacks {<br class="gmail_msg">
+ struct MappingInfo {<br class="gmail_msg">
+ explicit MappingInfo(ArrayRef<uint8_t> RecordData)<br class="gmail_msg">
+ : Stream(RecordData), Reader(Stream), Mapping(Reader) {}<br class="gmail_msg">
+<br class="gmail_msg">
+ msf::ByteStream Stream;<br class="gmail_msg">
+ msf::StreamReader Reader;<br class="gmail_msg">
+ SymbolRecordMapping Mapping;<br class="gmail_msg">
+ };<br class="gmail_msg">
+<br class="gmail_msg">
public:<br class="gmail_msg">
explicit SymbolDeserializer(SymbolVisitorDelegate *Delegate)<br class="gmail_msg">
: Delegate(Delegate) {}<br class="gmail_msg">
<br class="gmail_msg">
+ Error visitSymbolBegin(CVSymbol &Record) override {<br class="gmail_msg">
+ assert(!Mapping && "Already in a symbol mapping!");<br class="gmail_msg">
+ Mapping = llvm::make_unique<MappingInfo>(Record.content());<br class="gmail_msg">
+ return Mapping->Mapping.visitSymbolBegin(Record);<br class="gmail_msg">
+ }<br class="gmail_msg">
+ Error visitSymbolEnd(CVSymbol &Record) override {<br class="gmail_msg">
+ assert(Mapping && "Not in a symbol mapping!");<br class="gmail_msg">
+ auto EC = Mapping->Mapping.visitSymbolEnd(Record);<br class="gmail_msg">
+ Mapping.reset();<br class="gmail_msg">
+ return EC;<br class="gmail_msg">
+ }<br class="gmail_msg">
+<br class="gmail_msg">
#define SYMBOL_RECORD(EnumName, EnumVal, Name) \<br class="gmail_msg">
Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \<br class="gmail_msg">
- return defaultVisitKnownRecord(CVR, Record); \<br class="gmail_msg">
+ return visitKnownRecordImpl(CVR, Record); \<br class="gmail_msg">
}<br class="gmail_msg">
#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)<br class="gmail_msg">
#include "CVSymbolTypes.def"<br class="gmail_msg">
<br class="gmail_msg">
-protected:<br class="gmail_msg">
- template <typename T><br class="gmail_msg">
- Error deserializeRecord(msf::StreamReader &Reader, SymbolKind Kind,<br class="gmail_msg">
- T &Record) const {<br class="gmail_msg">
- uint32_t RecordOffset = Delegate ? Delegate->getRecordOffset(Reader) : 0;<br class="gmail_msg">
- SymbolRecordKind RK = static_cast<SymbolRecordKind>(Kind);<br class="gmail_msg">
- auto ExpectedRecord = T::deserialize(RK, RecordOffset, Reader);<br class="gmail_msg">
- if (!ExpectedRecord)<br class="gmail_msg">
- return ExpectedRecord.takeError();<br class="gmail_msg">
- Record = std::move(*ExpectedRecord);<br class="gmail_msg">
- return Error::success();<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
private:<br class="gmail_msg">
- template <typename T><br class="gmail_msg">
- Error defaultVisitKnownRecord(CVSymbol &CVR, T &Record) {<br class="gmail_msg">
- msf::ByteStream S(CVR.content());<br class="gmail_msg">
- msf::StreamReader SR(S);<br class="gmail_msg">
- if (auto EC = deserializeRecord(SR, CVR.Type, Record))<br class="gmail_msg">
+ template <typename T> Error visitKnownRecordImpl(CVSymbol &CVR, T &Record) {<br class="gmail_msg">
+<br class="gmail_msg">
+ Record.RecordOffset =<br class="gmail_msg">
+ Delegate ? Delegate->getRecordOffset(Mapping->Reader) : 0;<br class="gmail_msg">
+ if (auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))<br class="gmail_msg">
return EC;<br class="gmail_msg">
return Error::success();<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
SymbolVisitorDelegate *Delegate;<br class="gmail_msg">
+ std::unique_ptr<MappingInfo> Mapping;<br class="gmail_msg">
};<br class="gmail_msg">
}<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=290000&r1=289999&r2=290000&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=290000&r1=289999&r2=290000&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Fri Dec 16 16:48:14 2016<br class="gmail_msg">
@@ -29,10 +29,6 @@<br class="gmail_msg">
namespace llvm {<br class="gmail_msg">
namespace codeview {<br class="gmail_msg">
<br class="gmail_msg">
-using support::ulittle16_t;<br class="gmail_msg">
-using support::ulittle32_t;<br class="gmail_msg">
-using support::little32_t;<br class="gmail_msg">
-<br class="gmail_msg">
class SymbolRecord {<br class="gmail_msg">
protected:<br class="gmail_msg">
explicit SymbolRecord(SymbolRecordKind Kind) : Kind(Kind) {}<br class="gmail_msg">
@@ -47,181 +43,100 @@ private:<br class="gmail_msg">
// S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or<br class="gmail_msg">
// S_LPROC32_DPC_ID<br class="gmail_msg">
class ProcSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t PtrParent;<br class="gmail_msg">
- ulittle32_t PtrEnd;<br class="gmail_msg">
- ulittle32_t PtrNext;<br class="gmail_msg">
- ulittle32_t CodeSize;<br class="gmail_msg">
- ulittle32_t DbgStart;<br class="gmail_msg">
- ulittle32_t DbgEnd;<br class="gmail_msg">
- TypeIndex FunctionType;<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- uint8_t Flags; // ProcSymFlags enum<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 32;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit ProcSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- StringRef Name)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<ProcSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return ProcSym(Kind, RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t Parent = 0;<br class="gmail_msg">
+ uint32_t End = 0;<br class="gmail_msg">
+ uint32_t Next = 0;<br class="gmail_msg">
+ uint32_t CodeSize = 0;<br class="gmail_msg">
+ uint32_t DbgStart = 0;<br class="gmail_msg">
+ uint32_t DbgEnd = 0;<br class="gmail_msg">
+ TypeIndex FunctionType;<br class="gmail_msg">
+ uint32_t CodeOffset = 0;<br class="gmail_msg">
+ uint16_t Segment = 0;<br class="gmail_msg">
+ ProcSymFlags Flags = ProcSymFlags::None;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset = 0;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_THUNK32<br class="gmail_msg">
class Thunk32Sym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Parent;<br class="gmail_msg">
- ulittle32_t End;<br class="gmail_msg">
- ulittle32_t Next;<br class="gmail_msg">
- ulittle32_t Off;<br class="gmail_msg">
- ulittle16_t Seg;<br class="gmail_msg">
- ulittle16_t Len;<br class="gmail_msg">
- uint8_t Ord; // ThunkOrdinal enumeration<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- // Variant portion of thunk<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit Thunk32Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- StringRef Name, ArrayRef<uint8_t> VariantData)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name),<br class="gmail_msg">
- VariantData(VariantData) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<Thunk32Sym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- ArrayRef<uint8_t> VariantData;<br class="gmail_msg">
-<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name, CV_ARRAY_FIELD_TAIL(VariantData));<br class="gmail_msg">
-<br class="gmail_msg">
- return Thunk32Sym(Kind, RecordOffset, H, Name, VariantData);<br class="gmail_msg">
- }<br class="gmail_msg">
+ Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t Parent;<br class="gmail_msg">
+ uint32_t End;<br class="gmail_msg">
+ uint32_t Next;<br class="gmail_msg">
+ uint32_t Offset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ uint16_t Length;<br class="gmail_msg">
+ ThunkOrdinal Thunk;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
ArrayRef<uint8_t> VariantData;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_TRAMPOLINE<br class="gmail_msg">
class TrampolineSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle16_t Type; // TrampolineType enum<br class="gmail_msg">
- ulittle16_t Size;<br class="gmail_msg">
- ulittle32_t ThunkOff;<br class="gmail_msg">
- ulittle32_t TargetOff;<br class="gmail_msg">
- ulittle16_t ThunkSection;<br class="gmail_msg">
- ulittle16_t TargetSection;<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit TrampolineSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<TrampolineSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
-<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
+ TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return TrampolineSym(Kind, RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ TrampolineType Type;<br class="gmail_msg">
+ uint16_t Size;<br class="gmail_msg">
+ uint32_t ThunkOffset;<br class="gmail_msg">
+ uint32_t TargetOffset;<br class="gmail_msg">
+ uint16_t ThunkSection;<br class="gmail_msg">
+ uint16_t TargetSection;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_SECTION<br class="gmail_msg">
class SectionSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle16_t SectionNumber;<br class="gmail_msg">
- uint8_t Alignment;<br class="gmail_msg">
- uint8_t Reserved; // Must be 0<br class="gmail_msg">
- ulittle32_t Rva;<br class="gmail_msg">
- ulittle32_t Length;<br class="gmail_msg">
- ulittle32_t Characteristics;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit SectionSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- StringRef Name)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<SectionSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
-<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return SectionSym(Kind, RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint16_t SectionNumber;<br class="gmail_msg">
+ uint8_t Alignment;<br class="gmail_msg">
+ uint32_t Rva;<br class="gmail_msg">
+ uint32_t Length;<br class="gmail_msg">
+ uint32_t Characteristics;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_COFFGROUP<br class="gmail_msg">
class CoffGroupSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Size;<br class="gmail_msg">
- ulittle32_t Characteristics;<br class="gmail_msg">
- ulittle32_t Offset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit CoffGroupSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- StringRef Name)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<CoffGroupSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
-<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return CoffGroupSym(Kind, RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t Size;<br class="gmail_msg">
+ uint32_t Characteristics;<br class="gmail_msg">
+ uint32_t Offset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
class ScopeEndSym : public SymbolRecord {<br class="gmail_msg">
@@ -230,40 +145,17 @@ public:<br class="gmail_msg">
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- static Expected<ScopeEndSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- return ScopeEndSym(Kind, RecordOffset);<br class="gmail_msg">
- }<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
class CallerSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Count;<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit CallerSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *Header,<br class="gmail_msg">
- ArrayRef<TypeIndex> Indices)<br class="gmail_msg">
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*Header),<br class="gmail_msg">
- Indices(Indices) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<CallerSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *Header;<br class="gmail_msg">
- ArrayRef<TypeIndex> Indices;<br class="gmail_msg">
-<br class="gmail_msg">
- CV_DESERIALIZE(Reader, Header, CV_ARRAY_FIELD_N(Indices, Header->Count));<br class="gmail_msg">
-<br class="gmail_msg">
- return CallerSym(Kind, RecordOffset, Header, Indices);<br class="gmail_msg">
- }<br class="gmail_msg">
+ CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(Kind), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
+ std::vector<TypeIndex> Indices;<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<TypeIndex> Indices;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
struct BinaryAnnotationIterator {<br class="gmail_msg">
@@ -447,404 +339,219 @@ private:<br class="gmail_msg">
// S_INLINESITE<br class="gmail_msg">
class InlineSiteSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t PtrParent;<br class="gmail_msg">
- ulittle32_t PtrEnd;<br class="gmail_msg">
- TypeIndex Inlinee;<br class="gmail_msg">
- // BinaryAnnotations<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit InlineSiteSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- InlineSiteSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<uint8_t> Annotations)<br class="gmail_msg">
+ InlineSiteSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::InlineSiteSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Annotations(Annotations) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<InlineSiteSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<uint8_t> Annotations;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Annotations));<br class="gmail_msg">
-<br class="gmail_msg">
- return InlineSiteSym(RecordOffset, H, Annotations);<br class="gmail_msg">
- }<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
llvm::iterator_range<BinaryAnnotationIterator> annotations() const {<br class="gmail_msg">
- return llvm::make_range(BinaryAnnotationIterator(Annotations),<br class="gmail_msg">
+ return llvm::make_range(BinaryAnnotationIterator(AnnotationData),<br class="gmail_msg">
BinaryAnnotationIterator());<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t Parent;<br class="gmail_msg">
+ uint32_t End;<br class="gmail_msg">
+ TypeIndex Inlinee;<br class="gmail_msg">
+ std::vector<uint8_t> AnnotationData;<br class="gmail_msg">
<br class="gmail_msg">
-private:<br class="gmail_msg">
- ArrayRef<uint8_t> Annotations;<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_PUB32<br class="gmail_msg">
class PublicSym32 : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Index; // Type index, or Metadata token if a managed symbol<br class="gmail_msg">
- ulittle32_t Off;<br class="gmail_msg">
- ulittle16_t Seg;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit PublicSym32(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- PublicSym32(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::PublicSym32), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<PublicSym32> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return PublicSym32(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit PublicSym32(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::PublicSym32),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t Index;<br class="gmail_msg">
+ uint32_t Offset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_REGISTER<br class="gmail_msg">
class RegisterSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Index; // Type index or Metadata token<br class="gmail_msg">
- ulittle16_t Register; // RegisterId enumeration<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit RegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- RegisterSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::RegisterSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<RegisterSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ RegisterSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::RegisterSym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return RegisterSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t Index;<br class="gmail_msg">
+ RegisterId Register;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_PROCREF, S_LPROCREF<br class="gmail_msg">
class ProcRefSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t SumName; // SUC of the name (?)<br class="gmail_msg">
- ulittle32_t SymOffset; // Offset of actual symbol in $$Symbols<br class="gmail_msg">
- ulittle16_t Mod; // Module containing the actual symbol<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit ProcRefSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ProcRefSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<ProcRefSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return ProcRefSym(RecordOffset, H, Name);<br class="gmail_msg">
+ explicit ProcRefSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset) {<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t SumName;<br class="gmail_msg">
+ uint32_t SymOffset;<br class="gmail_msg">
+ uint16_t Module;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_LOCAL<br class="gmail_msg">
class LocalSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- ulittle16_t Flags; // LocalSymFlags enum<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit LocalSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- LocalSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<LocalSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ explicit LocalSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return LocalSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+ LocalSymFlags Flags;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
struct LocalVariableAddrRange {<br class="gmail_msg">
- ulittle32_t OffsetStart;<br class="gmail_msg">
- ulittle16_t ISectStart;<br class="gmail_msg">
- ulittle16_t Range;<br class="gmail_msg">
+ uint32_t OffsetStart;<br class="gmail_msg">
+ uint16_t ISectStart;<br class="gmail_msg">
+ uint16_t Range;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
struct LocalVariableAddrGap {<br class="gmail_msg">
- ulittle16_t GapStartOffset;<br class="gmail_msg">
- ulittle16_t Range;<br class="gmail_msg">
+ uint16_t GapStartOffset;<br class="gmail_msg">
+ uint16_t Range;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
enum : uint16_t { MaxDefRange = 0xf000 };<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE<br class="gmail_msg">
class DefRangeSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Program;<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 8;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit DefRangeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::DefRangeSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit DefRangeSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::DefRangeSym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ uint32_t Program;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_SUBFIELD<br class="gmail_msg">
class DefRangeSubfieldSym : public SymbolRecord {<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 12;<br class="gmail_msg">
+<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Program;<br class="gmail_msg">
- ulittle16_t OffsetInParent;<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
- };<br class="gmail_msg">
explicit DefRangeSubfieldSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeSubfieldSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
+ DefRangeSubfieldSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeSubfieldSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeSubfieldSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeSubfieldSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ uint32_t Program;<br class="gmail_msg">
+ uint16_t OffsetInParent;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_REGISTER<br class="gmail_msg">
class DefRangeRegisterSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
+ struct Header {<br class="gmail_msg">
ulittle16_t Register;<br class="gmail_msg">
ulittle16_t MayHaveNoName;<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
};<br class="gmail_msg">
-<br class="gmail_msg">
explicit DefRangeRegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeRegisterSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
+ DefRangeRegisterSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeRegisterSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- DefRangeRegisterSym(uint16_t Register, uint16_t MayHaveNoName,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::DefRangeRegisterSym), RecordOffset(0),<br class="gmail_msg">
- Gaps(Gaps) {<br class="gmail_msg">
- Header.Register = Register;<br class="gmail_msg">
- Header.MayHaveNoName = MayHaveNoName;<br class="gmail_msg">
- Header.Range = {};<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeRegisterSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
+ uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }<br class="gmail_msg">
<br class="gmail_msg">
- return DefRangeRegisterSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
- }<br class="gmail_msg">
+ Header Hdr;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_SUBFIELD_REGISTER<br class="gmail_msg">
class DefRangeSubfieldRegisterSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle16_t Register; // Register to which the variable is relative<br class="gmail_msg">
+ struct Header {<br class="gmail_msg">
+ ulittle16_t Register;<br class="gmail_msg">
ulittle16_t MayHaveNoName;<br class="gmail_msg">
ulittle32_t OffsetInParent;<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
};<br class="gmail_msg">
-<br class="gmail_msg">
explicit DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)<br class="gmail_msg">
: SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeSubfieldRegisterSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
+ DefRangeSubfieldRegisterSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeSubfieldRegisterSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- DefRangeSubfieldRegisterSym(uint16_t Register, uint16_t MayHaveNoName,<br class="gmail_msg">
- uint32_t OffsetInParent,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::DefRangeSubfieldRegisterSym),<br class="gmail_msg">
- RecordOffset(0), Gaps(Gaps) {<br class="gmail_msg">
- Header.Register = Register;<br class="gmail_msg">
- Header.MayHaveNoName = MayHaveNoName;<br class="gmail_msg">
- Header.OffsetInParent = OffsetInParent;<br class="gmail_msg">
- Header.Range = {};<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeSubfieldRegisterSym><br class="gmail_msg">
- deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeSubfieldRegisterSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
- }<br class="gmail_msg">
+ Header Hdr;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_FRAMEPOINTER_REL<br class="gmail_msg">
class DefRangeFramePointerRelSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- little32_t Offset; // Offset from the frame pointer register<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 8;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit DefRangeFramePointerRelSym(SymbolRecordKind Kind)<br class="gmail_msg">
: SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeFramePointerRelSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
+ DefRangeFramePointerRelSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeFramePointerRelSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeFramePointerRelSym><br class="gmail_msg">
- deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeFramePointerRelSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ int32_t Offset;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_REGISTER_REL<br class="gmail_msg">
class DefRangeRegisterRelSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle16_t BaseRegister;<br class="gmail_msg">
+ struct Header {<br class="gmail_msg">
+ ulittle16_t Register;<br class="gmail_msg">
ulittle16_t Flags;<br class="gmail_msg">
little32_t BasePointerOffset;<br class="gmail_msg">
- LocalVariableAddrRange Range;<br class="gmail_msg">
- // LocalVariableAddrGap Gaps[];<br class="gmail_msg">
};<br class="gmail_msg">
-<br class="gmail_msg">
explicit DefRangeRegisterRelSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeRegisterRelSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
+ explicit DefRangeRegisterRelSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeRegisterRelSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}<br class="gmail_msg">
-<br class="gmail_msg">
- DefRangeRegisterRelSym(uint16_t BaseRegister, uint16_t Flags,<br class="gmail_msg">
- int32_t BasePointerOffset,<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::DefRangeRegisterRelSym), RecordOffset(0),<br class="gmail_msg">
- Gaps(Gaps) {<br class="gmail_msg">
- Header.BaseRegister = BaseRegister;<br class="gmail_msg">
- Header.Flags = Flags;<br class="gmail_msg">
- Header.BasePointerOffset = BasePointerOffset;<br class="gmail_msg">
- Header.Range = {};<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DefRangeRegisterRelSym><br class="gmail_msg">
- deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeRegisterRelSym(RecordOffset, H, Gaps);<br class="gmail_msg">
- }<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
// The flags implement this notional bitfield:<br class="gmail_msg">
// uint16_t IsSubfield : 1;<br class="gmail_msg">
@@ -855,642 +562,379 @@ public:<br class="gmail_msg">
OffsetInParentShift = 4,<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
- bool hasSpilledUDTMember() const { return Header.Flags & IsSubfieldFlag; }<br class="gmail_msg">
- uint16_t offsetInParent() const { return Header.Flags >> OffsetInParentShift; }<br class="gmail_msg">
+ bool hasSpilledUDTMember() const { return Hdr.Flags & IsSubfieldFlag; }<br class="gmail_msg">
+ uint16_t offsetInParent() const { return Hdr.Flags >> OffsetInParentShift; }<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, Range);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }<br class="gmail_msg">
+<br class="gmail_msg">
+ Header Hdr;<br class="gmail_msg">
+ LocalVariableAddrRange Range;<br class="gmail_msg">
+ std::vector<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- ArrayRef<LocalVariableAddrGap> Gaps;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE<br class="gmail_msg">
class DefRangeFramePointerRelFullScopeSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- little32_t Offset; // Offset from the frame pointer register<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)<br class="gmail_msg">
: SymbolRecord(Kind) {}<br class="gmail_msg">
- DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
+ explicit DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::DefRangeFramePointerRelFullScopeSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- static Expected<DefRangeFramePointerRelFullScopeSym><br class="gmail_msg">
- deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
-<br class="gmail_msg">
- return DefRangeFramePointerRelFullScopeSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ int32_t Offset;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_BLOCK32<br class="gmail_msg">
class BlockSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t PtrParent;<br class="gmail_msg">
- ulittle32_t PtrEnd;<br class="gmail_msg">
- ulittle32_t CodeSize;<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 16;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit BlockSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- BlockSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<BlockSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return BlockSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit BlockSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t Parent;<br class="gmail_msg">
+ uint32_t End;<br class="gmail_msg">
+ uint32_t CodeSize;<br class="gmail_msg">
+ uint32_t CodeOffset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_LABEL32<br class="gmail_msg">
class LabelSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- uint8_t Flags; // CV_PROCFLAGS<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 4;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit LabelSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- LabelSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<LabelSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return LabelSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit LabelSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t CodeOffset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ ProcSymFlags Flags;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_OBJNAME<br class="gmail_msg">
class ObjNameSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Signature;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit ObjNameSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ObjNameSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<ObjNameSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return ObjNameSym(RecordOffset, H, Name);<br class="gmail_msg">
+ ObjNameSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset) {<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ uint32_t Signature;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_ENVBLOCK<br class="gmail_msg">
class EnvBlockSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- uint8_t Reserved;<br class="gmail_msg">
- // Sequence of zero terminated strings.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit EnvBlockSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- EnvBlockSym(uint32_t RecordOffset, const Hdr *H,<br class="gmail_msg">
- const std::vector<StringRef> &Fields)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::EnvBlockSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Fields(Fields) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<EnvBlockSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- std::vector<StringRef> Fields;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, CV_STRING_ARRAY_NULL_TERM(Fields));<br class="gmail_msg">
+ EnvBlockSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::EnvBlockSym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return EnvBlockSym(RecordOffset, H, Fields);<br class="gmail_msg">
- }<br class="gmail_msg">
+ std::vector<StringRef> Fields;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- std::vector<StringRef> Fields;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_EXPORT<br class="gmail_msg">
class ExportSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle16_t Ordinal;<br class="gmail_msg">
- ulittle16_t Flags; // ExportFlags<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit ExportSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ExportSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<ExportSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ ExportSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return ExportSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint16_t Ordinal;<br class="gmail_msg">
+ ExportFlags Flags;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_FILESTATIC<br class="gmail_msg">
class FileStaticSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Index; // Type Index<br class="gmail_msg">
- ulittle32_t ModFilenameOffset; // Index of mod filename in string table<br class="gmail_msg">
- ulittle16_t Flags; // LocalSymFlags enum<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit FileStaticSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- FileStaticSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
+ FileStaticSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::FileStaticSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<FileStaticSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return FileStaticSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t Index;<br class="gmail_msg">
+ uint32_t ModFilenameOffset;<br class="gmail_msg">
+ LocalSymFlags Flags;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_COMPILE2<br class="gmail_msg">
class Compile2Sym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t flags; // CompileSym2Flags enum<br class="gmail_msg">
- uint8_t getLanguage() const { return flags & 0xFF; }<br class="gmail_msg">
- unsigned short Machine; // CPUType enum<br class="gmail_msg">
- unsigned short VersionFrontendMajor;<br class="gmail_msg">
- unsigned short VersionFrontendMinor;<br class="gmail_msg">
- unsigned short VersionFrontendBuild;<br class="gmail_msg">
- unsigned short VersionBackendMajor;<br class="gmail_msg">
- unsigned short VersionBackendMinor;<br class="gmail_msg">
- unsigned short VersionBackendBuild;<br class="gmail_msg">
- // Version: The null-terminated version string follows.<br class="gmail_msg">
- // Optional block of zero terminated strings terminated with a double zero.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit Compile2Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- Compile2Sym(uint32_t RecordOffset, const Hdr *H, StringRef Version)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::Compile2Sym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Version(Version) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<Compile2Sym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Version;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Version);<br class="gmail_msg">
+ Compile2Sym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::Compile2Sym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
+<br class="gmail_msg">
+ CompileSym2Flags Flags;<br class="gmail_msg">
+ CPUType Machine;<br class="gmail_msg">
+ uint16_t VersionFrontendMajor;<br class="gmail_msg">
+ uint16_t VersionFrontendMinor;<br class="gmail_msg">
+ uint16_t VersionFrontendBuild;<br class="gmail_msg">
+ uint16_t VersionBackendMajor;<br class="gmail_msg">
+ uint16_t VersionBackendMinor;<br class="gmail_msg">
+ uint16_t VersionBackendBuild;<br class="gmail_msg">
+ StringRef Version;<br class="gmail_msg">
+ std::vector<StringRef> ExtraStrings;<br class="gmail_msg">
<br class="gmail_msg">
- return Compile2Sym(RecordOffset, H, Version);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }<br class="gmail_msg">
+ uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Version;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_COMPILE3<br class="gmail_msg">
class Compile3Sym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t flags; // CompileSym3Flags enum<br class="gmail_msg">
- uint8_t getLanguage() const { return flags & 0xff; }<br class="gmail_msg">
- ulittle16_t Machine; // CPUType enum<br class="gmail_msg">
- ulittle16_t VersionFrontendMajor;<br class="gmail_msg">
- ulittle16_t VersionFrontendMinor;<br class="gmail_msg">
- ulittle16_t VersionFrontendBuild;<br class="gmail_msg">
- ulittle16_t VersionFrontendQFE;<br class="gmail_msg">
- ulittle16_t VersionBackendMajor;<br class="gmail_msg">
- ulittle16_t VersionBackendMinor;<br class="gmail_msg">
- ulittle16_t VersionBackendBuild;<br class="gmail_msg">
- ulittle16_t VersionBackendQFE;<br class="gmail_msg">
- // VersionString: The null-terminated version string follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit Compile3Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- Compile3Sym(uint32_t RecordOffset, const Hdr *H, StringRef Version)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::Compile3Sym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Version(Version) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<Compile3Sym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Version;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Version);<br class="gmail_msg">
+ Compile3Sym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::Compile3Sym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
+<br class="gmail_msg">
+ CompileSym3Flags Flags;<br class="gmail_msg">
+ CPUType Machine;<br class="gmail_msg">
+ uint16_t VersionFrontendMajor;<br class="gmail_msg">
+ uint16_t VersionFrontendMinor;<br class="gmail_msg">
+ uint16_t VersionFrontendBuild;<br class="gmail_msg">
+ uint16_t VersionFrontendQFE;<br class="gmail_msg">
+ uint16_t VersionBackendMajor;<br class="gmail_msg">
+ uint16_t VersionBackendMinor;<br class="gmail_msg">
+ uint16_t VersionBackendBuild;<br class="gmail_msg">
+ uint16_t VersionBackendQFE;<br class="gmail_msg">
+ StringRef Version;<br class="gmail_msg">
<br class="gmail_msg">
- return Compile3Sym(RecordOffset, H, Version);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }<br class="gmail_msg">
+ uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Version;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_FRAMEPROC<br class="gmail_msg">
class FrameProcSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t TotalFrameBytes;<br class="gmail_msg">
- ulittle32_t PaddingFrameBytes;<br class="gmail_msg">
- ulittle32_t OffsetToPadding;<br class="gmail_msg">
- ulittle32_t BytesOfCalleeSavedRegisters;<br class="gmail_msg">
- ulittle32_t OffsetOfExceptionHandler;<br class="gmail_msg">
- ulittle16_t SectionIdOfExceptionHandler;<br class="gmail_msg">
- ulittle32_t Flags;<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit FrameProcSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- FrameProcSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
+ explicit FrameProcSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::FrameProcSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<FrameProcSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return FrameProcSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t TotalFrameBytes;<br class="gmail_msg">
+ uint32_t PaddingFrameBytes;<br class="gmail_msg">
+ uint32_t OffsetToPadding;<br class="gmail_msg">
+ uint32_t BytesOfCalleeSavedRegisters;<br class="gmail_msg">
+ uint32_t OffsetOfExceptionHandler;<br class="gmail_msg">
+ uint16_t SectionIdOfExceptionHandler;<br class="gmail_msg">
+ FrameProcedureOptions Flags;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_CALLSITEINFO<br class="gmail_msg">
class CallSiteInfoSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- ulittle16_t Reserved;<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 4;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit CallSiteInfoSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- CallSiteInfoSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::CallSiteInfoSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<CallSiteInfoSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
-<br class="gmail_msg">
- return CallSiteInfoSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit CallSiteInfoSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::CallSiteInfoSym) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ uint32_t CodeOffset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_HEAPALLOCSITE<br class="gmail_msg">
class HeapAllocationSiteSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- ulittle16_t CallInstructionSize;<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 4;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit HeapAllocationSiteSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- HeapAllocationSiteSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
+ explicit HeapAllocationSiteSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::HeapAllocationSiteSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<HeapAllocationSiteSym><br class="gmail_msg">
- deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
-<br class="gmail_msg">
- return HeapAllocationSiteSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ uint32_t CodeOffset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
+ uint16_t CallInstructionSize;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_FRAMECOOKIE<br class="gmail_msg">
class FrameCookieSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t CodeOffset;<br class="gmail_msg">
- ulittle16_t Register;<br class="gmail_msg">
- uint8_t CookieKind;<br class="gmail_msg">
- uint8_t Flags;<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 4;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit FrameCookieSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- FrameCookieSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::FrameCookieSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<FrameCookieSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
-<br class="gmail_msg">
- return FrameCookieSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ explicit FrameCookieSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::FrameCookieSym) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, CodeOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
+ uint32_t CodeOffset;<br class="gmail_msg">
+ uint16_t Register;<br class="gmail_msg">
+ uint8_t CookieKind;<br class="gmail_msg">
+ uint8_t Flags;<br class="gmail_msg">
+<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_UDT, S_COBOLUDT<br class="gmail_msg">
class UDTSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- TypeIndex Type; // Type of the UDT<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit UDTSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- UDTSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::UDTSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<UDTSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ explicit UDTSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::UDTSym) {}<br class="gmail_msg">
<br class="gmail_msg">
- return UDTSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_BUILDINFO<br class="gmail_msg">
class BuildInfoSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t BuildId;<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit BuildInfoSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- BuildInfoSym(uint32_t RecordOffset, const Hdr *H)<br class="gmail_msg">
+ BuildInfoSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::BuildInfoSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H) {}<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- static Expected<BuildInfoSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H);<br class="gmail_msg">
-<br class="gmail_msg">
- return BuildInfoSym(RecordOffset, H);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t BuildId;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_BPREL32<br class="gmail_msg">
class BPRelativeSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- little32_t Offset; // Offset from the base pointer register<br class="gmail_msg">
- TypeIndex Type; // Type of the variable<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit BPRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- BPRelativeSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
+ explicit BPRelativeSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::BPRelativeSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<BPRelativeSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return BPRelativeSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ int32_t Offset;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_REGREL32<br class="gmail_msg">
class RegRelativeSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- ulittle32_t Offset; // Offset from the register<br class="gmail_msg">
- TypeIndex Type; // Type of the variable<br class="gmail_msg">
- ulittle16_t Register; // Register to which the variable is relative<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit RegRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- RegRelativeSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
+ explicit RegRelativeSym(uint32_t RecordOffset)<br class="gmail_msg">
: SymbolRecord(SymbolRecordKind::RegRelativeSym),<br class="gmail_msg">
- RecordOffset(RecordOffset), Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<RegRelativeSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return RegRelativeSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ uint32_t Offset;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+ uint16_t Register;<br class="gmail_msg">
+ StringRef Name;<br class="gmail_msg">
<br class="gmail_msg">
uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_CONSTANT, S_MANCONSTANT<br class="gmail_msg">
class ConstantSym : public SymbolRecord {<br class="gmail_msg">
public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- // Value: The value of the constant.<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
-<br class="gmail_msg">
explicit ConstantSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ConstantSym(uint32_t RecordOffset, const Hdr *H, const APSInt &Value,<br class="gmail_msg">
- StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::ConstantSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Value(Value), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<ConstantSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- APSInt Value;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Value, Name);<br class="gmail_msg">
+ ConstantSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::ConstantSym),<br class="gmail_msg">
+ RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
- return ConstantSym(RecordOffset, H, Value, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
-<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
APSInt Value;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA<br class="gmail_msg">
class DataSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- ulittle32_t DataOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 8;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit DataSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- DataSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
- : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset),<br class="gmail_msg">
- Header(*H), Name(Name) {}<br class="gmail_msg">
-<br class="gmail_msg">
- static Expected<DataSym> deserialize(SymbolRecordKind Kind,<br class="gmail_msg">
- uint32_t RecordOffset,<br class="gmail_msg">
- msf::StreamReader &Reader) {<br class="gmail_msg">
- const Hdr *H = nullptr;<br class="gmail_msg">
- StringRef Name;<br class="gmail_msg">
- CV_DESERIALIZE(Reader, H, Name);<br class="gmail_msg">
-<br class="gmail_msg">
- return DataSym(RecordOffset, H, Name);<br class="gmail_msg">
- }<br class="gmail_msg">
+ DataSym(uint32_t RecordOffset)<br class="gmail_msg">
+ : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset) {}<br class="gmail_msg">
<br class="gmail_msg">
uint32_t getRelocationOffset() const {<br class="gmail_msg">
- return RecordOffset + offsetof(Hdr, DataOffset);<br class="gmail_msg">
+ return RecordOffset + RelocationOffset;<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
- uint32_t RecordOffset;<br class="gmail_msg">
- Hdr Header;<br class="gmail_msg">
+ TypeIndex Type;<br class="gmail_msg">
+ uint32_t DataOffset;<br class="gmail_msg">
+ uint16_t Segment;<br class="gmail_msg">
StringRef Name;<br class="gmail_msg">
+<br class="gmail_msg">
+ uint32_t RecordOffset;<br class="gmail_msg">
};<br class="gmail_msg">
<br class="gmail_msg">
// S_LTHREAD32, S_GTHREAD32<br class="gmail_msg">
class ThreadLocalDataSym : public SymbolRecord {<br class="gmail_msg">
-public:<br class="gmail_msg">
- struct Hdr {<br class="gmail_msg">
- TypeIndex Type;<br class="gmail_msg">
- ulittle32_t DataOffset;<br class="gmail_msg">
- ulittle16_t Segment;<br class="gmail_msg">
- // Name: The null-terminated name follows.<br class="gmail_msg">
- };<br class="gmail_msg">
+ static constexpr uint32_t RelocationOffset = 8;<br class="gmail_msg">
<br class="gmail_msg">
+public:<br class="gmail_msg">
explicit ThreadLocalDataSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}<br class="gmail_msg">
- ThreadLocalDataSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)<br class="gmail_msg">
+ explicit ThreadLocalDataSym(uint32_t Record</blockquote></div></div></blockquote></div></div>