[llvm] r289981 - Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 11:25:24 PST 2016
Author: zturner
Date: Fri Dec 16 13:25:23 2016
New Revision: 289981
URL: http://llvm.org/viewvc/llvm-project?rev=289981&view=rev
Log:
Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
This reverts commit r289978, which is failing due to some rebase/merge
issues.
Removed:
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h
llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt
llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
llvm/trunk/lib/MC/MCCodeView.cpp
llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test
llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h Fri Dec 16 13:25:23 2016
@@ -535,7 +535,7 @@ enum class ThunkOrdinal : uint8_t {
BranchIsland
};
-enum class TrampolineType : uint16_t { TrampIncremental, BranchIsland };
+enum class TrampolineType { TrampIncremental, BranchIsland };
// These values correspond to the CV_SourceChksum_t enumeration.
enum class FileChecksumKind : uint8_t { None, MD5, SHA1, SHA256 };
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Fri Dec 16 13:25:23 2016
@@ -46,17 +46,6 @@ public:
uint32_t maxFieldLength() const;
- template <typename T> Error mapObject(T &Value) {
- if (isWriting())
- return Writer->writeObject(Value);
-
- const T *ValuePtr;
- if (auto EC = Reader->readObject(ValuePtr))
- return EC;
- Value = *ValuePtr;
- return Error::success();
- }
-
template <typename T> Error mapInteger(T &Value) {
if (isWriting())
return Writer->writeInteger(Value);
@@ -86,8 +75,6 @@ public:
Error mapStringZ(StringRef &Value);
Error mapGuid(StringRef &Guid);
- Error mapStringZVectorZ(std::vector<StringRef> &Value);
-
template <typename SizeType, typename T, typename ElementMapper>
Error mapVectorN(T &Items, const ElementMapper &Mapper) {
SizeType Size;
@@ -134,7 +121,6 @@ public:
}
Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes);
- Error mapByteVectorTail(std::vector<uint8_t> &Bytes);
Error skipPadding();
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h Fri Dec 16 13:25:23 2016
@@ -12,7 +12,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
-#include "llvm/DebugInfo/CodeView/SymbolRecordMapping.h"
#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
#include "llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h"
#include "llvm/DebugInfo/MSF/ByteStream.h"
@@ -23,50 +22,41 @@ namespace llvm {
namespace codeview {
class SymbolVisitorDelegate;
class SymbolDeserializer : public SymbolVisitorCallbacks {
- struct MappingInfo {
- explicit MappingInfo(ArrayRef<uint8_t> RecordData)
- : Stream(RecordData), Reader(Stream), Mapping(Reader) {}
-
- msf::ByteStream Stream;
- msf::StreamReader Reader;
- SymbolRecordMapping Mapping;
- };
-
public:
explicit SymbolDeserializer(SymbolVisitorDelegate *Delegate)
: Delegate(Delegate) {}
- Error visitSymbolBegin(CVSymbol &Record) override {
- assert(!Mapping && "Already in a symbol mapping!");
- Mapping = llvm::make_unique<MappingInfo>(Record.content());
- return Mapping->Mapping.visitSymbolBegin(Record);
- }
- Error visitSymbolEnd(CVSymbol &Record) override {
- assert(Mapping && "Not in a symbol mapping!");
- auto EC = Mapping->Mapping.visitSymbolEnd(Record);
- Mapping.reset();
- return EC;
- }
-
#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \
- return visitKnownRecordImpl(CVR, Record); \
+ return defaultVisitKnownRecord(CVR, Record); \
}
#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
#include "CVSymbolTypes.def"
-private:
- template <typename T> Error visitKnownRecordImpl(CVSymbol &CVR, T &Record) {
+protected:
+ template <typename T>
+ Error deserializeRecord(msf::StreamReader &Reader, SymbolKind Kind,
+ T &Record) const {
+ uint32_t RecordOffset = Delegate ? Delegate->getRecordOffset(Reader) : 0;
+ SymbolRecordKind RK = static_cast<SymbolRecordKind>(Kind);
+ auto ExpectedRecord = T::deserialize(RK, RecordOffset, Reader);
+ if (!ExpectedRecord)
+ return ExpectedRecord.takeError();
+ Record = std::move(*ExpectedRecord);
+ return Error::success();
+ }
- Record.RecordOffset =
- Delegate ? Delegate->getRecordOffset(Mapping->Reader) : 0;
- if (auto EC = Mapping->Mapping.visitKnownRecord(CVR, Record))
+private:
+ template <typename T>
+ Error defaultVisitKnownRecord(CVSymbol &CVR, T &Record) {
+ msf::ByteStream S(CVR.content());
+ msf::StreamReader SR(S);
+ if (auto EC = deserializeRecord(SR, CVR.Type, Record))
return EC;
return Error::success();
}
SymbolVisitorDelegate *Delegate;
- std::unique_ptr<MappingInfo> Mapping;
};
}
}
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Fri Dec 16 13:25:23 2016
@@ -29,6 +29,10 @@
namespace llvm {
namespace codeview {
+using support::ulittle16_t;
+using support::ulittle32_t;
+using support::little32_t;
+
class SymbolRecord {
protected:
explicit SymbolRecord(SymbolRecordKind Kind) : Kind(Kind) {}
@@ -44,97 +48,180 @@ private:
// S_LPROC32_DPC_ID
class ProcSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t PtrParent;
+ ulittle32_t PtrEnd;
+ ulittle32_t PtrNext;
+ ulittle32_t CodeSize;
+ ulittle32_t DbgStart;
+ ulittle32_t DbgEnd;
+ TypeIndex FunctionType;
+ ulittle32_t CodeOffset;
+ ulittle16_t Segment;
+ uint8_t Flags; // ProcSymFlags enum
+ // Name: The null-terminated name follows.
+ };
+
explicit ProcSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset), Name(Name) {}
+ ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,
+ StringRef Name)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {
+ }
+
+ static Expected<ProcSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return ProcSym(Kind, RecordOffset, H, Name);
+ }
uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(ProcSym, CodeOffset);
+ return RecordOffset + offsetof(Hdr, CodeOffset);
}
- uint32_t Parent = 0;
- uint32_t End = 0;
- uint32_t Next = 0;
- uint32_t CodeSize = 0;
- uint32_t DbgStart = 0;
- uint32_t DbgEnd = 0;
- TypeIndex FunctionType;
- uint32_t CodeOffset = 0;
- uint16_t Segment = 0;
- ProcSymFlags Flags = ProcSymFlags::None;
+ uint32_t RecordOffset;
+ Hdr Header;
StringRef Name;
-
- uint32_t RecordOffset = 0;
};
// S_THUNK32
class Thunk32Sym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Parent;
+ ulittle32_t End;
+ ulittle32_t Next;
+ ulittle32_t Off;
+ ulittle16_t Seg;
+ ulittle16_t Len;
+ uint8_t Ord; // ThunkOrdinal enumeration
+ // Name: The null-terminated name follows.
+ // Variant portion of thunk
+ };
+
explicit Thunk32Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,
+ StringRef Name, ArrayRef<uint8_t> VariantData)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name),
+ VariantData(VariantData) {}
+
+ static Expected<Thunk32Sym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ ArrayRef<uint8_t> VariantData;
- uint32_t Parent;
- uint32_t End;
- uint32_t Next;
- uint32_t Offset;
- uint16_t Segment;
- uint16_t Length;
- ThunkOrdinal Thunk;
- StringRef Name;
- ArrayRef<uint8_t> VariantData;
+ CV_DESERIALIZE(Reader, H, Name, CV_ARRAY_FIELD_TAIL(VariantData));
+
+ return Thunk32Sym(Kind, RecordOffset, H, Name, VariantData);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
+ ArrayRef<uint8_t> VariantData;
};
// S_TRAMPOLINE
class TrampolineSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle16_t Type; // TrampolineType enum
+ ulittle16_t Size;
+ ulittle32_t ThunkOff;
+ ulittle32_t TargetOff;
+ ulittle16_t ThunkSection;
+ ulittle16_t TargetSection;
+ };
+
explicit TrampolineSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H) {}
+
+ static Expected<TrampolineSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
- TrampolineType Type;
- uint16_t Size;
- uint32_t ThunkOffset;
- uint32_t TargetOffset;
- uint16_t ThunkSection;
- uint16_t TargetSection;
+ CV_DESERIALIZE(Reader, H);
+
+ return TrampolineSym(Kind, RecordOffset, H);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_SECTION
class SectionSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle16_t SectionNumber;
+ uint8_t Alignment;
+ uint8_t Reserved; // Must be 0
+ ulittle32_t Rva;
+ ulittle32_t Length;
+ ulittle32_t Characteristics;
+ // Name: The null-terminated name follows.
+ };
+
explicit SectionSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,
+ StringRef Name)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {
+ }
- uint16_t SectionNumber;
- uint8_t Alignment;
- uint32_t Rva;
- uint32_t Length;
- uint32_t Characteristics;
- StringRef Name;
+ static Expected<SectionSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return SectionSym(Kind, RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_COFFGROUP
class CoffGroupSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Size;
+ ulittle32_t Characteristics;
+ ulittle32_t Offset;
+ ulittle16_t Segment;
+ // Name: The null-terminated name follows.
+ };
+
explicit CoffGroupSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *H,
+ StringRef Name)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*H), Name(Name) {
+ }
- uint32_t Size;
- uint32_t Characteristics;
- uint32_t Offset;
- uint16_t Segment;
- StringRef Name;
+ static Expected<CoffGroupSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return CoffGroupSym(Kind, RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
class ScopeEndSym : public SymbolRecord {
@@ -143,17 +230,40 @@ public:
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
: SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ static Expected<ScopeEndSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ return ScopeEndSym(Kind, RecordOffset);
+ }
uint32_t RecordOffset;
};
class CallerSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Count;
+ };
+
explicit CallerSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
- : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
+ CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset, const Hdr *Header,
+ ArrayRef<TypeIndex> Indices)
+ : SymbolRecord(Kind), RecordOffset(RecordOffset), Header(*Header),
+ Indices(Indices) {}
+
+ static Expected<CallerSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *Header;
+ ArrayRef<TypeIndex> Indices;
+
+ CV_DESERIALIZE(Reader, Header, CV_ARRAY_FIELD_N(Indices, Header->Count));
+
+ return CallerSym(Kind, RecordOffset, Header, Indices);
+ }
- std::vector<TypeIndex> Indices;
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<TypeIndex> Indices;
};
struct BinaryAnnotationIterator {
@@ -337,94 +447,168 @@ private:
// S_INLINESITE
class InlineSiteSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t PtrParent;
+ ulittle32_t PtrEnd;
+ TypeIndex Inlinee;
+ // BinaryAnnotations
+ };
+
explicit InlineSiteSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- InlineSiteSym(uint32_t RecordOffset)
+ InlineSiteSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<uint8_t> Annotations)
: SymbolRecord(SymbolRecordKind::InlineSiteSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Annotations(Annotations) {}
+
+ static Expected<InlineSiteSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<uint8_t> Annotations;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Annotations));
+
+ return InlineSiteSym(RecordOffset, H, Annotations);
+ }
llvm::iterator_range<BinaryAnnotationIterator> annotations() const {
- return llvm::make_range(BinaryAnnotationIterator(AnnotationData),
+ return llvm::make_range(BinaryAnnotationIterator(Annotations),
BinaryAnnotationIterator());
}
- uint32_t Parent;
- uint32_t End;
- TypeIndex Inlinee;
- std::vector<uint8_t> AnnotationData;
-
uint32_t RecordOffset;
+ Hdr Header;
+
+private:
+ ArrayRef<uint8_t> Annotations;
};
// S_PUB32
class PublicSym32 : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Index; // Type index, or Metadata token if a managed symbol
+ ulittle32_t Off;
+ ulittle16_t Seg;
+ // Name: The null-terminated name follows.
+ };
+
explicit PublicSym32(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit PublicSym32(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::PublicSym32),
- RecordOffset(RecordOffset) {}
-
- uint32_t Index;
- uint32_t Offset;
- uint16_t Segment;
- StringRef Name;
+ PublicSym32(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::PublicSym32), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<PublicSym32> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return PublicSym32(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_REGISTER
class RegisterSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Index; // Type index or Metadata token
+ ulittle16_t Register; // RegisterId enumeration
+ // Name: The null-terminated name follows.
+ };
+
explicit RegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- RegisterSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::RegisterSym),
- RecordOffset(RecordOffset) {}
+ RegisterSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::RegisterSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<RegisterSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t Index;
- RegisterId Register;
- StringRef Name;
+ return RegisterSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_PROCREF, S_LPROCREF
class ProcRefSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t SumName; // SUC of the name (?)
+ ulittle32_t SymOffset; // Offset of actual symbol in $$Symbols
+ ulittle16_t Mod; // Module containing the actual symbol
+ // Name: The null-terminated name follows.
+ };
+
explicit ProcRefSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit ProcRefSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset) {
- }
+ ProcRefSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<ProcRefSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t SumName;
- uint32_t SymOffset;
- uint16_t Module;
- StringRef Name;
+ return ProcRefSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_LOCAL
class LocalSym : public SymbolRecord {
public:
+ struct Hdr {
+ TypeIndex Type;
+ ulittle16_t Flags; // LocalSymFlags enum
+ // Name: The null-terminated name follows.
+ };
+
explicit LocalSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit LocalSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset) {}
+ LocalSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<LocalSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- TypeIndex Type;
- LocalSymFlags Flags;
- StringRef Name;
+ return LocalSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
struct LocalVariableAddrRange {
- uint32_t OffsetStart;
- uint16_t ISectStart;
- uint16_t Range;
+ ulittle32_t OffsetStart;
+ ulittle16_t ISectStart;
+ ulittle16_t Range;
};
struct LocalVariableAddrGap {
- uint16_t GapStartOffset;
- uint16_t Range;
+ ulittle16_t GapStartOffset;
+ ulittle16_t Range;
};
enum : uint16_t { MaxDefRange = 0xf000 };
@@ -432,118 +616,235 @@ enum : uint16_t { MaxDefRange = 0xf000 }
// S_DEFRANGE
class DefRangeSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Program;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
+ };
+
explicit DefRangeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit DefRangeSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::DefRangeSym),
- RecordOffset(RecordOffset) {}
+ DefRangeSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
+ : SymbolRecord(SymbolRecordKind::DefRangeSym), RecordOffset(RecordOffset),
+ Header(*H), Gaps(Gaps) {}
+
+ static Expected<DefRangeSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(DefRangeSym, Range);
+ return DefRangeSym(RecordOffset, H, Gaps);
}
- uint32_t Program;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_SUBFIELD
class DefRangeSubfieldSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Program;
+ ulittle16_t OffsetInParent;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
+ };
explicit DefRangeSubfieldSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- DefRangeSubfieldSym(uint32_t RecordOffset)
+ DefRangeSubfieldSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
: SymbolRecord(SymbolRecordKind::DefRangeSubfieldSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(DefRangeSubfieldSym, Range);
+ static Expected<DefRangeSubfieldSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
+
+ return DefRangeSubfieldSym(RecordOffset, H, Gaps);
}
- uint32_t Program;
- uint16_t OffsetInParent;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_REGISTER
class DefRangeRegisterSym : public SymbolRecord {
public:
- struct Header {
+ struct Hdr {
ulittle16_t Register;
ulittle16_t MayHaveNoName;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
};
+
explicit DefRangeRegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- DefRangeRegisterSym(uint32_t RecordOffset)
+ DefRangeRegisterSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
: SymbolRecord(SymbolRecordKind::DefRangeRegisterSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}
+
+ DefRangeRegisterSym(uint16_t Register, uint16_t MayHaveNoName,
+ ArrayRef<LocalVariableAddrGap> Gaps)
+ : SymbolRecord(SymbolRecordKind::DefRangeRegisterSym), RecordOffset(0),
+ Gaps(Gaps) {
+ Header.Register = Register;
+ Header.MayHaveNoName = MayHaveNoName;
+ Header.Range = {};
+ }
+
+ static Expected<DefRangeRegisterSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
- uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
+ return DefRangeRegisterSym(RecordOffset, H, Gaps);
+ }
- Header Hdr;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_SUBFIELD_REGISTER
class DefRangeSubfieldRegisterSym : public SymbolRecord {
public:
- struct Header {
- ulittle16_t Register;
+ struct Hdr {
+ ulittle16_t Register; // Register to which the variable is relative
ulittle16_t MayHaveNoName;
ulittle32_t OffsetInParent;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
};
+
explicit DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
: SymbolRecord(Kind) {}
- DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
+ DefRangeSubfieldRegisterSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
+ : SymbolRecord(SymbolRecordKind::DefRangeSubfieldRegisterSym),
+ RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}
+
+ DefRangeSubfieldRegisterSym(uint16_t Register, uint16_t MayHaveNoName,
+ uint32_t OffsetInParent,
+ ArrayRef<LocalVariableAddrGap> Gaps)
: SymbolRecord(SymbolRecordKind::DefRangeSubfieldRegisterSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(0), Gaps(Gaps) {
+ Header.Register = Register;
+ Header.MayHaveNoName = MayHaveNoName;
+ Header.OffsetInParent = OffsetInParent;
+ Header.Range = {};
+ }
- uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
+ static Expected<DefRangeSubfieldRegisterSym>
+ deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
- Header Hdr;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ return DefRangeSubfieldRegisterSym(RecordOffset, H, Gaps);
+ }
+
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_FRAMEPOINTER_REL
class DefRangeFramePointerRelSym : public SymbolRecord {
public:
+ struct Hdr {
+ little32_t Offset; // Offset from the frame pointer register
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
+ };
+
explicit DefRangeFramePointerRelSym(SymbolRecordKind Kind)
: SymbolRecord(Kind) {}
- DefRangeFramePointerRelSym(uint32_t RecordOffset)
+ DefRangeFramePointerRelSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
: SymbolRecord(SymbolRecordKind::DefRangeFramePointerRelSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(DefRangeFramePointerRelSym, Range);
+ static Expected<DefRangeFramePointerRelSym>
+ deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
+
+ return DefRangeFramePointerRelSym(RecordOffset, H, Gaps);
}
- int32_t Offset;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_REGISTER_REL
class DefRangeRegisterRelSym : public SymbolRecord {
public:
- struct Header {
- ulittle16_t Register;
+ struct Hdr {
+ ulittle16_t BaseRegister;
ulittle16_t Flags;
little32_t BasePointerOffset;
+ LocalVariableAddrRange Range;
+ // LocalVariableAddrGap Gaps[];
};
+
explicit DefRangeRegisterRelSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit DefRangeRegisterRelSym(uint32_t RecordOffset)
+ DefRangeRegisterRelSym(uint32_t RecordOffset, const Hdr *H,
+ ArrayRef<LocalVariableAddrGap> Gaps)
: SymbolRecord(SymbolRecordKind::DefRangeRegisterRelSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Gaps(Gaps) {}
+
+ DefRangeRegisterRelSym(uint16_t BaseRegister, uint16_t Flags,
+ int32_t BasePointerOffset,
+ ArrayRef<LocalVariableAddrGap> Gaps)
+ : SymbolRecord(SymbolRecordKind::DefRangeRegisterRelSym), RecordOffset(0),
+ Gaps(Gaps) {
+ Header.BaseRegister = BaseRegister;
+ Header.Flags = Flags;
+ Header.BasePointerOffset = BasePointerOffset;
+ Header.Range = {};
+ }
+
+ static Expected<DefRangeRegisterRelSym>
+ deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ ArrayRef<LocalVariableAddrGap> Gaps;
+ CV_DESERIALIZE(Reader, H, CV_ARRAY_FIELD_TAIL(Gaps));
+
+ return DefRangeRegisterRelSym(RecordOffset, H, Gaps);
+ }
// The flags implement this notional bitfield:
// uint16_t IsSubfield : 1;
@@ -554,365 +855,642 @@ public:
OffsetInParentShift = 4,
};
- bool hasSpilledUDTMember() const { return Hdr.Flags & IsSubfieldFlag; }
- uint16_t offsetInParent() const { return Hdr.Flags >> OffsetInParentShift; }
-
- uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
+ bool hasSpilledUDTMember() const { return Header.Flags & IsSubfieldFlag; }
+ uint16_t offsetInParent() const { return Header.Flags >> OffsetInParentShift; }
- Header Hdr;
- LocalVariableAddrRange Range;
- std::vector<LocalVariableAddrGap> Gaps;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, Range);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ ArrayRef<LocalVariableAddrGap> Gaps;
};
// S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
class DefRangeFramePointerRelFullScopeSym : public SymbolRecord {
public:
+ struct Hdr {
+ little32_t Offset; // Offset from the frame pointer register
+ };
+
explicit DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)
: SymbolRecord(Kind) {}
- explicit DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)
+ DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset, const Hdr *H)
: SymbolRecord(SymbolRecordKind::DefRangeFramePointerRelFullScopeSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H) {}
+
+ static Expected<DefRangeFramePointerRelFullScopeSym>
+ deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
- int32_t Offset;
+ return DefRangeFramePointerRelFullScopeSym(RecordOffset, H);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_BLOCK32
class BlockSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t PtrParent;
+ ulittle32_t PtrEnd;
+ ulittle32_t CodeSize;
+ ulittle32_t CodeOffset;
+ ulittle16_t Segment;
+ // Name: The null-terminated name follows.
+ };
+
explicit BlockSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit BlockSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset) {}
+ BlockSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<BlockSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(BlockSym, CodeOffset);
+ return BlockSym(RecordOffset, H, Name);
}
- uint32_t Parent;
- uint32_t End;
- uint32_t CodeSize;
- uint32_t CodeOffset;
- uint16_t Segment;
- StringRef Name;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, CodeOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_LABEL32
class LabelSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t CodeOffset;
+ ulittle16_t Segment;
+ uint8_t Flags; // CV_PROCFLAGS
+ // Name: The null-terminated name follows.
+ };
+
explicit LabelSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit LabelSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset) {}
+ LabelSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<LabelSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(LabelSym, CodeOffset);
+ return LabelSym(RecordOffset, H, Name);
}
- uint32_t CodeOffset;
- uint16_t Segment;
- ProcSymFlags Flags;
- StringRef Name;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, CodeOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_OBJNAME
class ObjNameSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Signature;
+ // Name: The null-terminated name follows.
+ };
+
explicit ObjNameSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- ObjNameSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset) {
- }
+ ObjNameSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<ObjNameSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t Signature;
- StringRef Name;
+ return ObjNameSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_ENVBLOCK
class EnvBlockSym : public SymbolRecord {
public:
+ struct Hdr {
+ uint8_t Reserved;
+ // Sequence of zero terminated strings.
+ };
+
explicit EnvBlockSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- EnvBlockSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::EnvBlockSym),
- RecordOffset(RecordOffset) {}
+ EnvBlockSym(uint32_t RecordOffset, const Hdr *H,
+ const std::vector<StringRef> &Fields)
+ : SymbolRecord(SymbolRecordKind::EnvBlockSym), RecordOffset(RecordOffset),
+ Header(*H), Fields(Fields) {}
- std::vector<StringRef> Fields;
+ static Expected<EnvBlockSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ std::vector<StringRef> Fields;
+ CV_DESERIALIZE(Reader, H, CV_STRING_ARRAY_NULL_TERM(Fields));
+
+ return EnvBlockSym(RecordOffset, H, Fields);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ std::vector<StringRef> Fields;
};
// S_EXPORT
class ExportSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle16_t Ordinal;
+ ulittle16_t Flags; // ExportFlags
+ // Name: The null-terminated name follows.
+ };
+
explicit ExportSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- ExportSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset) {}
+ ExportSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<ExportSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint16_t Ordinal;
- ExportFlags Flags;
- StringRef Name;
+ return ExportSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_FILESTATIC
class FileStaticSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Index; // Type Index
+ ulittle32_t ModFilenameOffset; // Index of mod filename in string table
+ ulittle16_t Flags; // LocalSymFlags enum
+ // Name: The null-terminated name follows.
+ };
+
explicit FileStaticSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- FileStaticSym(uint32_t RecordOffset)
+ FileStaticSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
: SymbolRecord(SymbolRecordKind::FileStaticSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Name(Name) {}
- uint32_t Index;
- uint32_t ModFilenameOffset;
- LocalSymFlags Flags;
- StringRef Name;
+ static Expected<FileStaticSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return FileStaticSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_COMPILE2
class Compile2Sym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t flags; // CompileSym2Flags enum
+ uint8_t getLanguage() const { return flags & 0xFF; }
+ unsigned short Machine; // CPUType enum
+ unsigned short VersionFrontendMajor;
+ unsigned short VersionFrontendMinor;
+ unsigned short VersionFrontendBuild;
+ unsigned short VersionBackendMajor;
+ unsigned short VersionBackendMinor;
+ unsigned short VersionBackendBuild;
+ // Version: The null-terminated version string follows.
+ // Optional block of zero terminated strings terminated with a double zero.
+ };
+
explicit Compile2Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- Compile2Sym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::Compile2Sym),
- RecordOffset(RecordOffset) {}
-
- CompileSym2Flags Flags;
- CPUType Machine;
- uint16_t VersionFrontendMajor;
- uint16_t VersionFrontendMinor;
- uint16_t VersionFrontendBuild;
- uint16_t VersionBackendMajor;
- uint16_t VersionBackendMinor;
- uint16_t VersionBackendBuild;
- StringRef Version;
- std::vector<StringRef> ExtraStrings;
+ Compile2Sym(uint32_t RecordOffset, const Hdr *H, StringRef Version)
+ : SymbolRecord(SymbolRecordKind::Compile2Sym), RecordOffset(RecordOffset),
+ Header(*H), Version(Version) {}
- uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }
- uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }
+ static Expected<Compile2Sym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Version;
+ CV_DESERIALIZE(Reader, H, Version);
+
+ return Compile2Sym(RecordOffset, H, Version);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Version;
};
// S_COMPILE3
class Compile3Sym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t flags; // CompileSym3Flags enum
+ uint8_t getLanguage() const { return flags & 0xff; }
+ ulittle16_t Machine; // CPUType enum
+ ulittle16_t VersionFrontendMajor;
+ ulittle16_t VersionFrontendMinor;
+ ulittle16_t VersionFrontendBuild;
+ ulittle16_t VersionFrontendQFE;
+ ulittle16_t VersionBackendMajor;
+ ulittle16_t VersionBackendMinor;
+ ulittle16_t VersionBackendBuild;
+ ulittle16_t VersionBackendQFE;
+ // VersionString: The null-terminated version string follows.
+ };
+
explicit Compile3Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- Compile3Sym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::Compile3Sym),
- RecordOffset(RecordOffset) {}
-
- CompileSym3Flags Flags;
- CPUType Machine;
- uint16_t VersionFrontendMajor;
- uint16_t VersionFrontendMinor;
- uint16_t VersionFrontendBuild;
- uint16_t VersionFrontendQFE;
- uint16_t VersionBackendMajor;
- uint16_t VersionBackendMinor;
- uint16_t VersionBackendBuild;
- uint16_t VersionBackendQFE;
- StringRef Version;
+ Compile3Sym(uint32_t RecordOffset, const Hdr *H, StringRef Version)
+ : SymbolRecord(SymbolRecordKind::Compile3Sym), RecordOffset(RecordOffset),
+ Header(*H), Version(Version) {}
- uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }
- uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }
+ static Expected<Compile3Sym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Version;
+ CV_DESERIALIZE(Reader, H, Version);
+
+ return Compile3Sym(RecordOffset, H, Version);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Version;
};
// S_FRAMEPROC
class FrameProcSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t TotalFrameBytes;
+ ulittle32_t PaddingFrameBytes;
+ ulittle32_t OffsetToPadding;
+ ulittle32_t BytesOfCalleeSavedRegisters;
+ ulittle32_t OffsetOfExceptionHandler;
+ ulittle16_t SectionIdOfExceptionHandler;
+ ulittle32_t Flags;
+ };
+
explicit FrameProcSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit FrameProcSym(uint32_t RecordOffset)
+ FrameProcSym(uint32_t RecordOffset, const Hdr *H)
: SymbolRecord(SymbolRecordKind::FrameProcSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H) {}
+
+ static Expected<FrameProcSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
- uint32_t TotalFrameBytes;
- uint32_t PaddingFrameBytes;
- uint32_t OffsetToPadding;
- uint32_t BytesOfCalleeSavedRegisters;
- uint32_t OffsetOfExceptionHandler;
- uint16_t SectionIdOfExceptionHandler;
- FrameProcedureOptions Flags;
+ return FrameProcSym(RecordOffset, H);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_CALLSITEINFO
class CallSiteInfoSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t CodeOffset;
+ ulittle16_t Segment;
+ ulittle16_t Reserved;
+ TypeIndex Type;
+ };
+
explicit CallSiteInfoSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit CallSiteInfoSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::CallSiteInfoSym) {}
+ CallSiteInfoSym(uint32_t RecordOffset, const Hdr *H)
+ : SymbolRecord(SymbolRecordKind::CallSiteInfoSym),
+ RecordOffset(RecordOffset), Header(*H) {}
+
+ static Expected<CallSiteInfoSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(CallSiteInfoSym, CodeOffset);
+ return CallSiteInfoSym(RecordOffset, H);
}
- uint32_t CodeOffset;
- uint16_t Segment;
- TypeIndex Type;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, CodeOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_HEAPALLOCSITE
class HeapAllocationSiteSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t CodeOffset;
+ ulittle16_t Segment;
+ ulittle16_t CallInstructionSize;
+ TypeIndex Type;
+ };
+
explicit HeapAllocationSiteSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit HeapAllocationSiteSym(uint32_t RecordOffset)
+ HeapAllocationSiteSym(uint32_t RecordOffset, const Hdr *H)
: SymbolRecord(SymbolRecordKind::HeapAllocationSiteSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H) {}
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(HeapAllocationSiteSym, CodeOffset);
+ static Expected<HeapAllocationSiteSym>
+ deserialize(SymbolRecordKind Kind, uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
+
+ return HeapAllocationSiteSym(RecordOffset, H);
}
- uint32_t CodeOffset;
- uint16_t Segment;
- uint16_t CallInstructionSize;
- TypeIndex Type;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, CodeOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_FRAMECOOKIE
class FrameCookieSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t CodeOffset;
+ ulittle16_t Register;
+ uint8_t CookieKind;
+ uint8_t Flags;
+ };
+
explicit FrameCookieSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit FrameCookieSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::FrameCookieSym) {}
+ FrameCookieSym(uint32_t RecordOffset, const Hdr *H)
+ : SymbolRecord(SymbolRecordKind::FrameCookieSym),
+ RecordOffset(RecordOffset), Header(*H) {}
+
+ static Expected<FrameCookieSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(FrameCookieSym, CodeOffset);
+ return FrameCookieSym(RecordOffset, H);
}
- uint32_t CodeOffset;
- uint16_t Register;
- uint8_t CookieKind;
- uint8_t Flags;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, CodeOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_UDT, S_COBOLUDT
class UDTSym : public SymbolRecord {
public:
+ struct Hdr {
+ TypeIndex Type; // Type of the UDT
+ // Name: The null-terminated name follows.
+ };
+
explicit UDTSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit UDTSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::UDTSym) {}
+ UDTSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::UDTSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<UDTSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- TypeIndex Type;
- StringRef Name;
+ return UDTSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_BUILDINFO
class BuildInfoSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t BuildId;
+ };
+
explicit BuildInfoSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- BuildInfoSym(uint32_t RecordOffset)
+ BuildInfoSym(uint32_t RecordOffset, const Hdr *H)
: SymbolRecord(SymbolRecordKind::BuildInfoSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H) {}
- uint32_t BuildId;
+ static Expected<BuildInfoSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ CV_DESERIALIZE(Reader, H);
+
+ return BuildInfoSym(RecordOffset, H);
+ }
uint32_t RecordOffset;
+ Hdr Header;
};
// S_BPREL32
class BPRelativeSym : public SymbolRecord {
public:
+ struct Hdr {
+ little32_t Offset; // Offset from the base pointer register
+ TypeIndex Type; // Type of the variable
+ // Name: The null-terminated name follows.
+ };
+
explicit BPRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit BPRelativeSym(uint32_t RecordOffset)
+ BPRelativeSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
: SymbolRecord(SymbolRecordKind::BPRelativeSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Name(Name) {}
- int32_t Offset;
- TypeIndex Type;
- StringRef Name;
+ static Expected<BPRelativeSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return BPRelativeSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_REGREL32
class RegRelativeSym : public SymbolRecord {
public:
+ struct Hdr {
+ ulittle32_t Offset; // Offset from the register
+ TypeIndex Type; // Type of the variable
+ ulittle16_t Register; // Register to which the variable is relative
+ // Name: The null-terminated name follows.
+ };
+
explicit RegRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit RegRelativeSym(uint32_t RecordOffset)
+ RegRelativeSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
: SymbolRecord(SymbolRecordKind::RegRelativeSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Name(Name) {}
- uint32_t Offset;
- TypeIndex Type;
- uint16_t Register;
- StringRef Name;
+ static Expected<RegRelativeSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return RegRelativeSym(RecordOffset, H, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_CONSTANT, S_MANCONSTANT
class ConstantSym : public SymbolRecord {
public:
+ struct Hdr {
+ TypeIndex Type;
+ // Value: The value of the constant.
+ // Name: The null-terminated name follows.
+ };
+
explicit ConstantSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- ConstantSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::ConstantSym),
- RecordOffset(RecordOffset) {}
+ ConstantSym(uint32_t RecordOffset, const Hdr *H, const APSInt &Value,
+ StringRef Name)
+ : SymbolRecord(SymbolRecordKind::ConstantSym), RecordOffset(RecordOffset),
+ Header(*H), Value(Value), Name(Name) {}
+
+ static Expected<ConstantSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ APSInt Value;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Value, Name);
- TypeIndex Type;
- APSInt Value;
- StringRef Name;
+ return ConstantSym(RecordOffset, H, Value, Name);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ APSInt Value;
+ StringRef Name;
};
// S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
class DataSym : public SymbolRecord {
public:
+ struct Hdr {
+ TypeIndex Type;
+ ulittle32_t DataOffset;
+ ulittle16_t Segment;
+ // Name: The null-terminated name follows.
+ };
+
explicit DataSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- DataSym(uint32_t RecordOffset)
- : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset) {}
+ DataSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
+ : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset),
+ Header(*H), Name(Name) {}
+
+ static Expected<DataSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(DataSym, DataOffset);
+ return DataSym(RecordOffset, H, Name);
}
- TypeIndex Type;
- uint32_t DataOffset;
- uint16_t Segment;
- StringRef Name;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, DataOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
// S_LTHREAD32, S_GTHREAD32
class ThreadLocalDataSym : public SymbolRecord {
public:
+ struct Hdr {
+ TypeIndex Type;
+ ulittle32_t DataOffset;
+ ulittle16_t Segment;
+ // Name: The null-terminated name follows.
+ };
+
explicit ThreadLocalDataSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
- explicit ThreadLocalDataSym(uint32_t RecordOffset)
+ ThreadLocalDataSym(uint32_t RecordOffset, const Hdr *H, StringRef Name)
: SymbolRecord(SymbolRecordKind::ThreadLocalDataSym),
- RecordOffset(RecordOffset) {}
+ RecordOffset(RecordOffset), Header(*H), Name(Name) {}
- uint32_t getRelocationOffset() const {
- return RecordOffset + offsetof(ThreadLocalDataSym, DataOffset);
+ static Expected<ThreadLocalDataSym> deserialize(SymbolRecordKind Kind,
+ uint32_t RecordOffset,
+ msf::StreamReader &Reader) {
+ const Hdr *H = nullptr;
+ StringRef Name;
+ CV_DESERIALIZE(Reader, H, Name);
+
+ return ThreadLocalDataSym(RecordOffset, H, Name);
}
- TypeIndex Type;
- uint32_t DataOffset;
- uint16_t Segment;
- StringRef Name;
+ uint32_t getRelocationOffset() const {
+ return RecordOffset + offsetof(Hdr, DataOffset);
+ }
uint32_t RecordOffset;
+ Hdr Header;
+ StringRef Name;
};
typedef CVRecord<SymbolKind> CVSymbol;
Removed: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h?rev=289980&view=auto
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h (removed)
@@ -1,44 +0,0 @@
-//===- SymbolRecordMapping.h ------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDMAPPING_H
-#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDMAPPING_H
-
-#include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
-#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
-
-namespace llvm {
-namespace msf {
-class StreamReader;
-class StreamWriter;
-}
-
-namespace codeview {
-class SymbolRecordMapping : public SymbolVisitorCallbacks {
-public:
- explicit SymbolRecordMapping(msf::StreamReader &Reader) : IO(Reader) {}
- explicit SymbolRecordMapping(msf::StreamWriter &Writer) : IO(Writer) {}
-
- Error visitSymbolBegin(CVSymbol &Record) override;
- Error visitSymbolEnd(CVSymbol &Record) override;
-
-#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
- Error visitKnownRecord(CVSymbol &CVR, Name &Record) override;
-#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#include "CVSymbolTypes.def"
-
-private:
- Optional<SymbolKind> Kind;
-
- CodeViewRecordIO IO;
-};
-}
-}
-
-#endif
Removed: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h?rev=289980&view=auto
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h (removed)
@@ -1,96 +0,0 @@
-//===- symbolSerializer.h ---------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLSERIALIZER_H
-#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLSERIALIZER_H
-
-#include "llvm/DebugInfo/CodeView/SymbolRecordMapping.h"
-#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
-#include "llvm/DebugInfo/Msf/ByteStream.h"
-#include "llvm/DebugInfo/Msf/StreamWriter.h"
-
-#include "llvm/ADT/Optional.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/iterator_range.h"
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/Error.h"
-
-namespace llvm {
-namespace codeview {
-
-class SymbolSerializer : public SymbolVisitorCallbacks {
- uint32_t RecordStart = 0;
- msf::StreamWriter &Writer;
- SymbolRecordMapping Mapping;
- Optional<SymbolKind> CurrentSymbol;
-
- Error writeRecordPrefix(SymbolKind Kind) {
- RecordPrefix Prefix;
- Prefix.RecordKind = Kind;
- Prefix.RecordLen = 0;
- if (auto EC = Writer.writeObject(Prefix))
- return EC;
- return Error::success();
- }
-
-public:
- explicit SymbolSerializer(msf::StreamWriter &Writer)
- : Writer(Writer), Mapping(Writer) {}
-
- virtual Error visitSymbolBegin(CVSymbol &Record) override {
- assert(!CurrentSymbol.hasValue() && "Already in a symbol mapping!");
-
- RecordStart = Writer.getOffset();
- if (auto EC = writeRecordPrefix(Record.kind()))
- return EC;
-
- CurrentSymbol = Record.kind();
- if (auto EC = Mapping.visitSymbolBegin(Record))
- return EC;
-
- return Error::success();
- }
-
- virtual Error visitSymbolEnd(CVSymbol &Record) override {
- assert(CurrentSymbol.hasValue() && "Not in a symbol mapping!");
-
- if (auto EC = Mapping.visitSymbolEnd(Record))
- return EC;
-
- uint32_t RecordEnd = Writer.getOffset();
- Writer.setOffset(RecordStart);
- uint16_t Length = RecordEnd - Writer.getOffset() - 2;
- if (auto EC = Writer.writeInteger(Length))
- return EC;
-
- Writer.setOffset(RecordEnd);
- CurrentSymbol.reset();
-
- return Error::success();
- }
-
-#define SYMBOL_RECORD(EnumName, EnumVal, Name) \
- virtual Error visitKnownRecord(CVSymbol &CVR, Name &Record) override { \
- return visitKnownRecordImpl(CVR, Record); \
- }
-#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#include "CVSymbolTypes.def"
-
-private:
- template <typename RecordKind>
- Error visitKnownRecordImpl(CVSymbol &CVR, RecordKind &Record) {
- return Mapping.visitKnownRecord(CVR, Record);
- }
-};
-}
-}
-
-#endif
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Fri Dec 16 13:25:23 2016
@@ -2072,39 +2072,35 @@ void CodeViewDebug::emitLocalVariable(co
(DefRange.StructOffset
<< DefRangeRegisterRelSym::OffsetInParentShift);
}
- DefRangeRegisterRelSym Sym(S_DEFRANGE_REGISTER_REL);
- Sym.Hdr.Register = DefRange.CVRegister;
- Sym.Hdr.Flags = RegRelFlags;
- Sym.Hdr.BasePointerOffset = DefRange.DataOffset;
+ DefRangeRegisterRelSym Sym(DefRange.CVRegister, RegRelFlags,
+ DefRange.DataOffset, None);
ulittle16_t SymKind = ulittle16_t(S_DEFRANGE_REGISTER_REL);
BytePrefix +=
StringRef(reinterpret_cast<const char *>(&SymKind), sizeof(SymKind));
BytePrefix +=
- StringRef(reinterpret_cast<const char *>(&Sym.Hdr), sizeof(Sym.Hdr));
+ StringRef(reinterpret_cast<const char *>(&Sym.Header),
+ sizeof(Sym.Header) - sizeof(LocalVariableAddrRange));
} else {
assert(DefRange.DataOffset == 0 && "unexpected offset into register");
if (DefRange.IsSubfield) {
// Unclear what matters here.
- DefRangeSubfieldRegisterSym Sym(S_DEFRANGE_SUBFIELD_REGISTER);
- Sym.Hdr.Register = DefRange.CVRegister;
- Sym.Hdr.MayHaveNoName = 0;
- Sym.Hdr.OffsetInParent = DefRange.StructOffset;
-
+ DefRangeSubfieldRegisterSym Sym(DefRange.CVRegister, 0,
+ DefRange.StructOffset, None);
ulittle16_t SymKind = ulittle16_t(S_DEFRANGE_SUBFIELD_REGISTER);
BytePrefix += StringRef(reinterpret_cast<const char *>(&SymKind),
sizeof(SymKind));
- BytePrefix += StringRef(reinterpret_cast<const char *>(&Sym.Hdr),
- sizeof(Sym.Hdr));
+ BytePrefix +=
+ StringRef(reinterpret_cast<const char *>(&Sym.Header),
+ sizeof(Sym.Header) - sizeof(LocalVariableAddrRange));
} else {
// Unclear what matters here.
- DefRangeRegisterSym Sym(S_DEFRANGE_REGISTER);
- Sym.Hdr.Register = DefRange.CVRegister;
- Sym.Hdr.MayHaveNoName = 0;
+ DefRangeRegisterSym Sym(DefRange.CVRegister, 0, None);
ulittle16_t SymKind = ulittle16_t(S_DEFRANGE_REGISTER);
BytePrefix += StringRef(reinterpret_cast<const char *>(&SymKind),
sizeof(SymKind));
- BytePrefix += StringRef(reinterpret_cast<const char *>(&Sym.Hdr),
- sizeof(Sym.Hdr));
+ BytePrefix +=
+ StringRef(reinterpret_cast<const char *>(&Sym.Header),
+ sizeof(Sym.Header) - sizeof(LocalVariableAddrRange));
}
}
OS.EmitCVDefRangeDirective(DefRange.Ranges, BytePrefix);
Modified: llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/CMakeLists.txt Fri Dec 16 13:25:23 2016
@@ -8,9 +8,7 @@ add_llvm_library(LLVMDebugInfoCodeView
ModuleSubstream.cpp
ModuleSubstreamVisitor.cpp
RecordSerialization.cpp
- SymbolRecordMapping.cpp
SymbolDumper.cpp
- SymbolSerializer.cpp
TypeDumper.cpp
TypeRecord.cpp
TypeRecordMapping.cpp
Modified: llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp Fri Dec 16 13:25:23 2016
@@ -75,16 +75,6 @@ Error CodeViewRecordIO::mapByteVectorTai
return Error::success();
}
-Error CodeViewRecordIO::mapByteVectorTail(std::vector<uint8_t> &Bytes) {
- ArrayRef<uint8_t> BytesRef(Bytes);
- if (auto EC = mapByteVectorTail(BytesRef))
- return EC;
- if (!isWriting())
- Bytes.assign(BytesRef.begin(), BytesRef.end());
-
- return Error::success();
-}
-
Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd) {
if (isWriting()) {
if (auto EC = Writer->writeInteger(TypeInd.getIndex()))
@@ -169,27 +159,6 @@ Error CodeViewRecordIO::mapGuid(StringRe
}
return Error::success();
}
-
-Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value) {
- if (isWriting()) {
- for (auto V : Value) {
- if (auto EC = mapStringZ(V))
- return EC;
- }
- if (auto EC = Writer->writeInteger(uint8_t(0)))
- return EC;
- } else {
- StringRef S;
- if (auto EC = mapStringZ(S))
- return EC;
- while (!S.empty()) {
- Value.push_back(S);
- if (auto EC = mapStringZ(S))
- return EC;
- };
- }
- return Error::success();
-}
Error CodeViewRecordIO::writeEncodedSignedInteger(const int64_t &Value) {
assert(Value < 0 && "Encoded integer is not signed!");
Modified: llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp Fri Dec 16 13:25:23 2016
@@ -94,14 +94,14 @@ Error CVSymbolDumperImpl::visitKnownReco
DictScope S(W, "BlockStart");
StringRef LinkageName;
- W.printHex("PtrParent", Block.Parent);
- W.printHex("PtrEnd", Block.End);
- W.printHex("CodeSize", Block.CodeSize);
+ W.printHex("PtrParent", Block.Header.PtrParent);
+ W.printHex("PtrEnd", Block.Header.PtrEnd);
+ W.printHex("CodeSize", Block.Header.CodeSize);
if (ObjDelegate) {
ObjDelegate->printRelocatedField("CodeOffset", Block.getRelocationOffset(),
- Block.CodeOffset, &LinkageName);
+ Block.Header.CodeOffset, &LinkageName);
}
- W.printHex("Segment", Block.Segment);
+ W.printHex("Segment", Block.Header.Segment);
W.printString("BlockName", Block.Name);
W.printString("LinkageName", LinkageName);
return Error::success();
@@ -109,35 +109,36 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, Thunk32Sym &Thunk) {
DictScope S(W, "Thunk32");
- W.printNumber("Parent", Thunk.Parent);
- W.printNumber("End", Thunk.End);
- W.printNumber("Next", Thunk.Next);
- W.printNumber("Off", Thunk.Offset);
- W.printNumber("Seg", Thunk.Segment);
- W.printNumber("Len", Thunk.Length);
- W.printEnum("Ordinal", uint8_t(Thunk.Thunk), getThunkOrdinalNames());
+ W.printNumber("Parent", Thunk.Header.Parent);
+ W.printNumber("End", Thunk.Header.End);
+ W.printNumber("Next", Thunk.Header.Next);
+ W.printNumber("Off", Thunk.Header.Off);
+ W.printNumber("Seg", Thunk.Header.Seg);
+ W.printNumber("Len", Thunk.Header.Len);
+ W.printEnum("Ordinal", Thunk.Header.Ord, getThunkOrdinalNames());
return Error::success();
}
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
TrampolineSym &Tramp) {
DictScope S(W, "Trampoline");
- W.printEnum("Type", uint16_t(Tramp.Type), getTrampolineNames());
- W.printNumber("Size", Tramp.Size);
- W.printNumber("ThunkOff", Tramp.ThunkOffset);
- W.printNumber("TargetOff", Tramp.TargetOffset);
- W.printNumber("ThunkSection", Tramp.ThunkSection);
- W.printNumber("TargetSection", Tramp.TargetSection);
+ W.printEnum("Type", Tramp.Header.Type, getTrampolineNames());
+ W.printNumber("Size", Tramp.Header.Size);
+ W.printNumber("ThunkOff", Tramp.Header.ThunkOff);
+ W.printNumber("TargetOff", Tramp.Header.TargetOff);
+ W.printNumber("ThunkSection", Tramp.Header.ThunkSection);
+ W.printNumber("TargetSection", Tramp.Header.TargetSection);
return Error::success();
}
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, SectionSym &Section) {
DictScope S(W, "Section");
- W.printNumber("SectionNumber", Section.SectionNumber);
- W.printNumber("Alignment", Section.Alignment);
- W.printNumber("Rva", Section.Rva);
- W.printNumber("Length", Section.Length);
- W.printFlags("Characteristics", Section.Characteristics,
+ W.printNumber("SectionNumber", Section.Header.SectionNumber);
+ W.printNumber("Alignment", Section.Header.Alignment);
+ W.printNumber("Reserved", Section.Header.Reserved);
+ W.printNumber("Rva", Section.Header.Rva);
+ W.printNumber("Length", Section.Header.Length);
+ W.printFlags("Characteristics", Section.Header.Characteristics,
getImageSectionCharacteristicNames(),
COFF::SectionCharacteristics(0x00F00000));
@@ -148,12 +149,12 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
CoffGroupSym &CoffGroup) {
DictScope S(W, "COFF Group");
- W.printNumber("Size", CoffGroup.Size);
- W.printFlags("Characteristics", CoffGroup.Characteristics,
+ W.printNumber("Size", CoffGroup.Header.Size);
+ W.printFlags("Characteristics", CoffGroup.Header.Characteristics,
getImageSectionCharacteristicNames(),
COFF::SectionCharacteristics(0x00F00000));
- W.printNumber("Offset", CoffGroup.Offset);
- W.printNumber("Segment", CoffGroup.Segment);
+ W.printNumber("Offset", CoffGroup.Header.Offset);
+ W.printNumber("Segment", CoffGroup.Header.Segment);
W.printString("Name", CoffGroup.Name);
return Error::success();
}
@@ -162,8 +163,8 @@ Error CVSymbolDumperImpl::visitKnownReco
BPRelativeSym &BPRel) {
DictScope S(W, "BPRelativeSym");
- W.printNumber("Offset", BPRel.Offset);
- CVTD.printTypeIndex("Type", BPRel.Type);
+ W.printNumber("Offset", BPRel.Header.Offset);
+ CVTD.printTypeIndex("Type", BPRel.Header.Type);
W.printString("VarName", BPRel.Name);
return Error::success();
}
@@ -172,7 +173,7 @@ Error CVSymbolDumperImpl::visitKnownReco
BuildInfoSym &BuildInfo) {
DictScope S(W, "BuildInfo");
- W.printNumber("BuildId", BuildInfo.BuildId);
+ W.printNumber("BuildId", BuildInfo.Header.BuildId);
return Error::success();
}
@@ -182,12 +183,13 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
- ObjDelegate->printRelocatedField("CodeOffset",
- CallSiteInfo.getRelocationOffset(),
- CallSiteInfo.CodeOffset, &LinkageName);
- }
- W.printHex("Segment", CallSiteInfo.Segment);
- CVTD.printTypeIndex("Type", CallSiteInfo.Type);
+ ObjDelegate->printRelocatedField(
+ "CodeOffset", CallSiteInfo.getRelocationOffset(),
+ CallSiteInfo.Header.CodeOffset, &LinkageName);
+ }
+ W.printHex("Segment", CallSiteInfo.Header.Segment);
+ W.printHex("Reserved", CallSiteInfo.Header.Reserved);
+ CVTD.printTypeIndex("Type", CallSiteInfo.Header.Type);
if (!LinkageName.empty())
W.printString("LinkageName", LinkageName);
return Error::success();
@@ -197,6 +199,7 @@ Error CVSymbolDumperImpl::visitKnownReco
EnvBlockSym &EnvBlock) {
DictScope S(W, "EnvBlock");
+ W.printNumber("Reserved", EnvBlock.Header.Reserved);
ListScope L(W, "Entries");
for (auto Entry : EnvBlock.Fields) {
W.printString(Entry);
@@ -207,17 +210,17 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
FileStaticSym &FileStatic) {
DictScope S(W, "FileStatic");
- W.printNumber("Index", FileStatic.Index);
- W.printNumber("ModFilenameOffset", FileStatic.ModFilenameOffset);
- W.printFlags("Flags", uint16_t(FileStatic.Flags), getLocalFlagNames());
+ W.printNumber("Index", FileStatic.Header.Index);
+ W.printNumber("ModFilenameOffset", FileStatic.Header.ModFilenameOffset);
+ W.printFlags("Flags", uint16_t(FileStatic.Header.Flags), getLocalFlagNames());
W.printString("Name", FileStatic.Name);
return Error::success();
}
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, ExportSym &Export) {
DictScope S(W, "Export");
- W.printNumber("Ordinal", Export.Ordinal);
- W.printFlags("Flags", uint16_t(Export.Flags), getExportSymFlagNames());
+ W.printNumber("Ordinal", Export.Header.Ordinal);
+ W.printFlags("Flags", Export.Header.Flags, getExportSymFlagNames());
W.printString("Name", Export.Name);
return Error::success();
}
@@ -226,20 +229,24 @@ Error CVSymbolDumperImpl::visitKnownReco
Compile2Sym &Compile2) {
DictScope S(W, "CompilerFlags2");
- W.printEnum("Language", Compile2.getLanguage(), getSourceLanguageNames());
- W.printFlags("Flags", Compile2.getFlags(), getCompileSym2FlagNames());
- W.printEnum("Machine", unsigned(Compile2.Machine), getCPUTypeNames());
+ W.printEnum("Language", Compile2.Header.getLanguage(),
+ getSourceLanguageNames());
+ W.printFlags("Flags", Compile2.Header.flags & ~0xff,
+ getCompileSym2FlagNames());
+ W.printEnum("Machine", unsigned(Compile2.Header.Machine), getCPUTypeNames());
std::string FrontendVersion;
{
raw_string_ostream Out(FrontendVersion);
- Out << Compile2.VersionFrontendMajor << '.' << Compile2.VersionFrontendMinor
- << '.' << Compile2.VersionFrontendBuild;
+ Out << Compile2.Header.VersionFrontendMajor << '.'
+ << Compile2.Header.VersionFrontendMinor << '.'
+ << Compile2.Header.VersionFrontendBuild;
}
std::string BackendVersion;
{
raw_string_ostream Out(BackendVersion);
- Out << Compile2.VersionBackendMajor << '.' << Compile2.VersionBackendMinor
- << '.' << Compile2.VersionBackendBuild;
+ Out << Compile2.Header.VersionBackendMajor << '.'
+ << Compile2.Header.VersionBackendMinor << '.'
+ << Compile2.Header.VersionBackendBuild;
}
W.printString("FrontendVersion", FrontendVersion);
W.printString("BackendVersion", BackendVersion);
@@ -251,22 +258,26 @@ Error CVSymbolDumperImpl::visitKnownReco
Compile3Sym &Compile3) {
DictScope S(W, "CompilerFlags3");
- W.printEnum("Language", Compile3.getLanguage(), getSourceLanguageNames());
- W.printFlags("Flags", Compile3.getFlags(), getCompileSym3FlagNames());
- W.printEnum("Machine", unsigned(Compile3.Machine), getCPUTypeNames());
+ W.printEnum("Language", Compile3.Header.getLanguage(),
+ getSourceLanguageNames());
+ W.printFlags("Flags", Compile3.Header.flags & ~0xff,
+ getCompileSym3FlagNames());
+ W.printEnum("Machine", unsigned(Compile3.Header.Machine), getCPUTypeNames());
std::string FrontendVersion;
{
raw_string_ostream Out(FrontendVersion);
- Out << Compile3.VersionFrontendMajor << '.' << Compile3.VersionFrontendMinor
- << '.' << Compile3.VersionFrontendBuild << '.'
- << Compile3.VersionFrontendQFE;
+ Out << Compile3.Header.VersionFrontendMajor << '.'
+ << Compile3.Header.VersionFrontendMinor << '.'
+ << Compile3.Header.VersionFrontendBuild << '.'
+ << Compile3.Header.VersionFrontendQFE;
}
std::string BackendVersion;
{
raw_string_ostream Out(BackendVersion);
- Out << Compile3.VersionBackendMajor << '.' << Compile3.VersionBackendMinor
- << '.' << Compile3.VersionBackendBuild << '.'
- << Compile3.VersionBackendQFE;
+ Out << Compile3.Header.VersionBackendMajor << '.'
+ << Compile3.Header.VersionBackendMinor << '.'
+ << Compile3.Header.VersionBackendBuild << '.'
+ << Compile3.Header.VersionBackendQFE;
}
W.printString("FrontendVersion", FrontendVersion);
W.printString("BackendVersion", BackendVersion);
@@ -278,7 +289,7 @@ Error CVSymbolDumperImpl::visitKnownReco
ConstantSym &Constant) {
DictScope S(W, "Constant");
- CVTD.printTypeIndex("Type", Constant.Type);
+ CVTD.printTypeIndex("Type", Constant.Header.Type);
W.printNumber("Value", Constant.Value);
W.printString("Name", Constant.Name);
return Error::success();
@@ -291,9 +302,9 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
ObjDelegate->printRelocatedField("DataOffset", Data.getRelocationOffset(),
- Data.DataOffset, &LinkageName);
+ Data.Header.DataOffset, &LinkageName);
}
- CVTD.printTypeIndex("Type", Data.Type);
+ CVTD.printTypeIndex("Type", Data.Header.Type);
W.printString("DisplayName", Data.Name);
if (!LinkageName.empty())
W.printString("LinkageName", LinkageName);
@@ -304,7 +315,7 @@ Error CVSymbolDumperImpl::visitKnownReco
CVSymbol &CVR,
DefRangeFramePointerRelFullScopeSym &DefRangeFramePointerRelFullScope) {
DictScope S(W, "DefRangeFramePointerRelFullScope");
- W.printNumber("Offset", DefRangeFramePointerRelFullScope.Offset);
+ W.printNumber("Offset", DefRangeFramePointerRelFullScope.Header.Offset);
return Error::success();
}
@@ -312,8 +323,8 @@ Error CVSymbolDumperImpl::visitKnownReco
CVSymbol &CVR, DefRangeFramePointerRelSym &DefRangeFramePointerRel) {
DictScope S(W, "DefRangeFramePointerRel");
- W.printNumber("Offset", DefRangeFramePointerRel.Offset);
- printLocalVariableAddrRange(DefRangeFramePointerRel.Range,
+ W.printNumber("Offset", DefRangeFramePointerRel.Header.Offset);
+ printLocalVariableAddrRange(DefRangeFramePointerRel.Header.Range,
DefRangeFramePointerRel.getRelocationOffset());
printLocalVariableAddrGap(DefRangeFramePointerRel.Gaps);
return Error::success();
@@ -323,12 +334,13 @@ Error CVSymbolDumperImpl::visitKnownReco
CVSymbol &CVR, DefRangeRegisterRelSym &DefRangeRegisterRel) {
DictScope S(W, "DefRangeRegisterRel");
- W.printNumber("BaseRegister", DefRangeRegisterRel.Hdr.Register);
+ W.printNumber("BaseRegister", DefRangeRegisterRel.Header.BaseRegister);
W.printBoolean("HasSpilledUDTMember",
DefRangeRegisterRel.hasSpilledUDTMember());
W.printNumber("OffsetInParent", DefRangeRegisterRel.offsetInParent());
- W.printNumber("BasePointerOffset", DefRangeRegisterRel.Hdr.BasePointerOffset);
- printLocalVariableAddrRange(DefRangeRegisterRel.Range,
+ W.printNumber("BasePointerOffset",
+ DefRangeRegisterRel.Header.BasePointerOffset);
+ printLocalVariableAddrRange(DefRangeRegisterRel.Header.Range,
DefRangeRegisterRel.getRelocationOffset());
printLocalVariableAddrGap(DefRangeRegisterRel.Gaps);
return Error::success();
@@ -338,9 +350,9 @@ Error CVSymbolDumperImpl::visitKnownReco
CVSymbol &CVR, DefRangeRegisterSym &DefRangeRegister) {
DictScope S(W, "DefRangeRegister");
- W.printNumber("Register", DefRangeRegister.Hdr.Register);
- W.printNumber("MayHaveNoName", DefRangeRegister.Hdr.MayHaveNoName);
- printLocalVariableAddrRange(DefRangeRegister.Range,
+ W.printNumber("Register", DefRangeRegister.Header.Register);
+ W.printNumber("MayHaveNoName", DefRangeRegister.Header.MayHaveNoName);
+ printLocalVariableAddrRange(DefRangeRegister.Header.Range,
DefRangeRegister.getRelocationOffset());
printLocalVariableAddrGap(DefRangeRegister.Gaps);
return Error::success();
@@ -350,10 +362,11 @@ Error CVSymbolDumperImpl::visitKnownReco
CVSymbol &CVR, DefRangeSubfieldRegisterSym &DefRangeSubfieldRegister) {
DictScope S(W, "DefRangeSubfieldRegister");
- W.printNumber("Register", DefRangeSubfieldRegister.Hdr.Register);
- W.printNumber("MayHaveNoName", DefRangeSubfieldRegister.Hdr.MayHaveNoName);
- W.printNumber("OffsetInParent", DefRangeSubfieldRegister.Hdr.OffsetInParent);
- printLocalVariableAddrRange(DefRangeSubfieldRegister.Range,
+ W.printNumber("Register", DefRangeSubfieldRegister.Header.Register);
+ W.printNumber("MayHaveNoName", DefRangeSubfieldRegister.Header.MayHaveNoName);
+ W.printNumber("OffsetInParent",
+ DefRangeSubfieldRegister.Header.OffsetInParent);
+ printLocalVariableAddrRange(DefRangeSubfieldRegister.Header.Range,
DefRangeSubfieldRegister.getRelocationOffset());
printLocalVariableAddrGap(DefRangeSubfieldRegister.Gaps);
return Error::success();
@@ -365,7 +378,7 @@ Error CVSymbolDumperImpl::visitKnownReco
if (ObjDelegate) {
StringRef StringTable = ObjDelegate->getStringTable();
- auto ProgramStringTableOffset = DefRangeSubfield.Program;
+ auto ProgramStringTableOffset = DefRangeSubfield.Header.Program;
if (ProgramStringTableOffset >= StringTable.size())
return llvm::make_error<CodeViewError>(
"String table offset outside of bounds of String Table!");
@@ -373,8 +386,8 @@ Error CVSymbolDumperImpl::visitKnownReco
StringTable.drop_front(ProgramStringTableOffset).split('\0').first;
W.printString("Program", Program);
}
- W.printNumber("OffsetInParent", DefRangeSubfield.OffsetInParent);
- printLocalVariableAddrRange(DefRangeSubfield.Range,
+ W.printNumber("OffsetInParent", DefRangeSubfield.Header.OffsetInParent);
+ printLocalVariableAddrRange(DefRangeSubfield.Header.Range,
DefRangeSubfield.getRelocationOffset());
printLocalVariableAddrGap(DefRangeSubfield.Gaps);
return Error::success();
@@ -386,7 +399,7 @@ Error CVSymbolDumperImpl::visitKnownReco
if (ObjDelegate) {
StringRef StringTable = ObjDelegate->getStringTable();
- auto ProgramStringTableOffset = DefRange.Program;
+ auto ProgramStringTableOffset = DefRange.Header.Program;
if (ProgramStringTableOffset >= StringTable.size())
return llvm::make_error<CodeViewError>(
"String table offset outside of bounds of String Table!");
@@ -394,7 +407,8 @@ Error CVSymbolDumperImpl::visitKnownReco
StringTable.drop_front(ProgramStringTableOffset).split('\0').first;
W.printString("Program", Program);
}
- printLocalVariableAddrRange(DefRange.Range, DefRange.getRelocationOffset());
+ printLocalVariableAddrRange(DefRange.Header.Range,
+ DefRange.getRelocationOffset());
printLocalVariableAddrGap(DefRange.Gaps);
return Error::success();
}
@@ -405,14 +419,14 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
- ObjDelegate->printRelocatedField("CodeOffset",
- FrameCookie.getRelocationOffset(),
- FrameCookie.CodeOffset, &LinkageName);
+ ObjDelegate->printRelocatedField(
+ "CodeOffset", FrameCookie.getRelocationOffset(),
+ FrameCookie.Header.CodeOffset, &LinkageName);
}
- W.printHex("Register", FrameCookie.Register);
- W.printEnum("CookieKind", uint16_t(FrameCookie.CookieKind),
+ W.printHex("Register", FrameCookie.Header.Register);
+ W.printEnum("CookieKind", uint16_t(FrameCookie.Header.CookieKind),
getFrameCookieKindNames());
- W.printHex("Flags", FrameCookie.Flags);
+ W.printHex("Flags", FrameCookie.Header.Flags);
return Error::success();
}
@@ -420,16 +434,16 @@ Error CVSymbolDumperImpl::visitKnownReco
FrameProcSym &FrameProc) {
DictScope S(W, "FrameProc");
- W.printHex("TotalFrameBytes", FrameProc.TotalFrameBytes);
- W.printHex("PaddingFrameBytes", FrameProc.PaddingFrameBytes);
- W.printHex("OffsetToPadding", FrameProc.OffsetToPadding);
+ W.printHex("TotalFrameBytes", FrameProc.Header.TotalFrameBytes);
+ W.printHex("PaddingFrameBytes", FrameProc.Header.PaddingFrameBytes);
+ W.printHex("OffsetToPadding", FrameProc.Header.OffsetToPadding);
W.printHex("BytesOfCalleeSavedRegisters",
- FrameProc.BytesOfCalleeSavedRegisters);
- W.printHex("OffsetOfExceptionHandler", FrameProc.OffsetOfExceptionHandler);
+ FrameProc.Header.BytesOfCalleeSavedRegisters);
+ W.printHex("OffsetOfExceptionHandler",
+ FrameProc.Header.OffsetOfExceptionHandler);
W.printHex("SectionIdOfExceptionHandler",
- FrameProc.SectionIdOfExceptionHandler);
- W.printFlags("Flags", static_cast<uint32_t>(FrameProc.Flags),
- getFrameProcSymFlagNames());
+ FrameProc.Header.SectionIdOfExceptionHandler);
+ W.printFlags("Flags", FrameProc.Header.Flags, getFrameProcSymFlagNames());
return Error::success();
}
@@ -439,13 +453,13 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
- ObjDelegate->printRelocatedField("CodeOffset",
- HeapAllocSite.getRelocationOffset(),
- HeapAllocSite.CodeOffset, &LinkageName);
- }
- W.printHex("Segment", HeapAllocSite.Segment);
- W.printHex("CallInstructionSize", HeapAllocSite.CallInstructionSize);
- CVTD.printTypeIndex("Type", HeapAllocSite.Type);
+ ObjDelegate->printRelocatedField(
+ "CodeOffset", HeapAllocSite.getRelocationOffset(),
+ HeapAllocSite.Header.CodeOffset, &LinkageName);
+ }
+ W.printHex("Segment", HeapAllocSite.Header.Segment);
+ W.printHex("CallInstructionSize", HeapAllocSite.Header.CallInstructionSize);
+ CVTD.printTypeIndex("Type", HeapAllocSite.Header.Type);
if (!LinkageName.empty())
W.printString("LinkageName", LinkageName);
return Error::success();
@@ -455,9 +469,9 @@ Error CVSymbolDumperImpl::visitKnownReco
InlineSiteSym &InlineSite) {
DictScope S(W, "InlineSite");
- W.printHex("PtrParent", InlineSite.Parent);
- W.printHex("PtrEnd", InlineSite.End);
- CVTD.printTypeIndex("Inlinee", InlineSite.Inlinee);
+ W.printHex("PtrParent", InlineSite.Header.PtrParent);
+ W.printHex("PtrEnd", InlineSite.Header.PtrEnd);
+ CVTD.printTypeIndex("Inlinee", InlineSite.Header.Inlinee);
ListScope BinaryAnnotations(W, "BinaryAnnotations");
for (auto &Annotation : InlineSite.annotations()) {
@@ -511,26 +525,26 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR,
RegisterSym &Register) {
DictScope S(W, "RegisterSym");
- W.printNumber("Type", Register.Index);
- W.printEnum("Seg", uint16_t(Register.Register), getRegisterNames());
+ W.printNumber("Type", Register.Header.Index);
+ W.printEnum("Seg", uint16_t(Register.Header.Register), getRegisterNames());
W.printString("Name", Register.Name);
return Error::success();
}
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, PublicSym32 &Public) {
DictScope S(W, "PublicSym");
- W.printNumber("Type", Public.Index);
- W.printNumber("Seg", Public.Segment);
- W.printNumber("Off", Public.Offset);
+ W.printNumber("Type", Public.Header.Index);
+ W.printNumber("Seg", Public.Header.Seg);
+ W.printNumber("Off", Public.Header.Off);
W.printString("Name", Public.Name);
return Error::success();
}
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, ProcRefSym &ProcRef) {
DictScope S(W, "ProcRef");
- W.printNumber("SumName", ProcRef.SumName);
- W.printNumber("SymOffset", ProcRef.SymOffset);
- W.printNumber("Mod", ProcRef.Module);
+ W.printNumber("SumName", ProcRef.Header.SumName);
+ W.printNumber("SymOffset", ProcRef.Header.SymOffset);
+ W.printNumber("Mod", ProcRef.Header.Mod);
W.printString("Name", ProcRef.Name);
return Error::success();
}
@@ -541,11 +555,11 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
ObjDelegate->printRelocatedField("CodeOffset", Label.getRelocationOffset(),
- Label.CodeOffset, &LinkageName);
+ Label.Header.CodeOffset, &LinkageName);
}
- W.printHex("Segment", Label.Segment);
- W.printHex("Flags", uint8_t(Label.Flags));
- W.printFlags("Flags", uint8_t(Label.Flags), getProcSymFlagNames());
+ W.printHex("Segment", Label.Header.Segment);
+ W.printHex("Flags", Label.Header.Flags);
+ W.printFlags("Flags", Label.Header.Flags, getProcSymFlagNames());
W.printString("DisplayName", Label.Name);
if (!LinkageName.empty())
W.printString("LinkageName", LinkageName);
@@ -555,8 +569,8 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, LocalSym &Local) {
DictScope S(W, "Local");
- CVTD.printTypeIndex("Type", Local.Type);
- W.printFlags("Flags", uint16_t(Local.Flags), getLocalFlagNames());
+ CVTD.printTypeIndex("Type", Local.Header.Type);
+ W.printFlags("Flags", uint16_t(Local.Header.Flags), getLocalFlagNames());
W.printString("VarName", Local.Name);
return Error::success();
}
@@ -564,7 +578,7 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, ObjNameSym &ObjName) {
DictScope S(W, "ObjectName");
- W.printHex("Signature", ObjName.Signature);
+ W.printHex("Signature", ObjName.Header.Signature);
W.printString("ObjectName", ObjName.Name);
return Error::success();
}
@@ -580,19 +594,19 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
W.printEnum("Kind", uint16_t(CVR.kind()), getSymbolTypeNames());
- W.printHex("PtrParent", Proc.Parent);
- W.printHex("PtrEnd", Proc.End);
- W.printHex("PtrNext", Proc.Next);
- W.printHex("CodeSize", Proc.CodeSize);
- W.printHex("DbgStart", Proc.DbgStart);
- W.printHex("DbgEnd", Proc.DbgEnd);
- CVTD.printTypeIndex("FunctionType", Proc.FunctionType);
+ W.printHex("PtrParent", Proc.Header.PtrParent);
+ W.printHex("PtrEnd", Proc.Header.PtrEnd);
+ W.printHex("PtrNext", Proc.Header.PtrNext);
+ W.printHex("CodeSize", Proc.Header.CodeSize);
+ W.printHex("DbgStart", Proc.Header.DbgStart);
+ W.printHex("DbgEnd", Proc.Header.DbgEnd);
+ CVTD.printTypeIndex("FunctionType", Proc.Header.FunctionType);
if (ObjDelegate) {
ObjDelegate->printRelocatedField("CodeOffset", Proc.getRelocationOffset(),
- Proc.CodeOffset, &LinkageName);
+ Proc.Header.CodeOffset, &LinkageName);
}
- W.printHex("Segment", Proc.Segment);
- W.printFlags("Flags", static_cast<uint8_t>(Proc.Flags),
+ W.printHex("Segment", Proc.Header.Segment);
+ W.printFlags("Flags", static_cast<uint8_t>(Proc.Header.Flags),
getProcSymFlagNames());
W.printString("DisplayName", Proc.Name);
if (!LinkageName.empty())
@@ -624,9 +638,9 @@ Error CVSymbolDumperImpl::visitKnownReco
RegRelativeSym &RegRel) {
DictScope S(W, "RegRelativeSym");
- W.printHex("Offset", RegRel.Offset);
- CVTD.printTypeIndex("Type", RegRel.Type);
- W.printHex("Register", RegRel.Register);
+ W.printHex("Offset", RegRel.Header.Offset);
+ CVTD.printTypeIndex("Type", RegRel.Header.Type);
+ W.printHex("Register", RegRel.Header.Register);
W.printString("VarName", RegRel.Name);
return Error::success();
}
@@ -638,9 +652,9 @@ Error CVSymbolDumperImpl::visitKnownReco
StringRef LinkageName;
if (ObjDelegate) {
ObjDelegate->printRelocatedField("DataOffset", Data.getRelocationOffset(),
- Data.DataOffset, &LinkageName);
+ Data.Header.DataOffset, &LinkageName);
}
- CVTD.printTypeIndex("Type", Data.Type);
+ CVTD.printTypeIndex("Type", Data.Header.Type);
W.printString("DisplayName", Data.Name);
if (!LinkageName.empty())
W.printString("LinkageName", LinkageName);
@@ -649,7 +663,7 @@ Error CVSymbolDumperImpl::visitKnownReco
Error CVSymbolDumperImpl::visitKnownRecord(CVSymbol &CVR, UDTSym &UDT) {
DictScope S(W, "UDT");
- CVTD.printTypeIndex("Type", UDT.Type);
+ CVTD.printTypeIndex("Type", UDT.Header.Type);
W.printString("UDTName", UDT.Name);
return Error::success();
}
Removed: llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp?rev=289980&view=auto
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp (removed)
@@ -1,464 +0,0 @@
-//===- SymbolRecordMapping.cpp -----------------------------------*- C++-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/DebugInfo/CodeView/SymbolRecordMapping.h"
-
-using namespace llvm;
-using namespace llvm::codeview;
-
-#define error(X) \
- if (auto EC = X) \
- return EC;
-
-namespace {
-struct MapGap {
- Error operator()(CodeViewRecordIO &IO, LocalVariableAddrGap &Gap) const {
- error(IO.mapInteger(Gap.GapStartOffset));
- error(IO.mapInteger(Gap.Range));
- return Error::success();
- }
-};
-}
-
-static Error mapLocalVariableAddrRange(CodeViewRecordIO &IO,
- LocalVariableAddrRange &Range) {
- error(IO.mapInteger(Range.OffsetStart));
- error(IO.mapInteger(Range.ISectStart));
- error(IO.mapInteger(Range.Range));
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitSymbolBegin(CVSymbol &Record) {
- error(IO.beginRecord(MaxRecordLength - sizeof(RecordPrefix)));
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitSymbolEnd(CVSymbol &Record) {
- error(IO.endRecord());
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, BlockSym &Block) {
-
- error(IO.mapInteger(Block.Parent));
- error(IO.mapInteger(Block.End));
- error(IO.mapInteger(Block.CodeSize));
- error(IO.mapInteger(Block.CodeOffset));
- error(IO.mapInteger(Block.Segment));
- error(IO.mapStringZ(Block.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, Thunk32Sym &Thunk) {
-
- error(IO.mapInteger(Thunk.Parent));
- error(IO.mapInteger(Thunk.End));
- error(IO.mapInteger(Thunk.Next));
- error(IO.mapInteger(Thunk.Offset));
- error(IO.mapInteger(Thunk.Segment));
- error(IO.mapInteger(Thunk.Length));
- error(IO.mapEnum(Thunk.Thunk));
- error(IO.mapStringZ(Thunk.Name));
- error(IO.mapByteVectorTail(Thunk.VariantData));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- TrampolineSym &Tramp) {
-
- error(IO.mapEnum(Tramp.Type));
- error(IO.mapInteger(Tramp.Size));
- error(IO.mapInteger(Tramp.ThunkOffset));
- error(IO.mapInteger(Tramp.TargetOffset));
- error(IO.mapInteger(Tramp.ThunkSection));
- error(IO.mapInteger(Tramp.TargetSection));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- SectionSym &Section) {
- uint8_t Padding = 0;
-
- error(IO.mapInteger(Section.SectionNumber));
- error(IO.mapInteger(Section.Alignment));
- error(IO.mapInteger(Padding));
- error(IO.mapInteger(Section.Rva));
- error(IO.mapInteger(Section.Length));
- error(IO.mapInteger(Section.Characteristics));
- error(IO.mapStringZ(Section.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- CoffGroupSym &CoffGroup) {
-
- error(IO.mapInteger(CoffGroup.Size));
- error(IO.mapInteger(CoffGroup.Characteristics));
- error(IO.mapInteger(CoffGroup.Offset));
- error(IO.mapInteger(CoffGroup.Segment));
- error(IO.mapStringZ(CoffGroup.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- BPRelativeSym &BPRel) {
-
- error(IO.mapInteger(BPRel.Offset));
- error(IO.mapInteger(BPRel.Type));
- error(IO.mapStringZ(BPRel.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- BuildInfoSym &BuildInfo) {
-
- error(IO.mapInteger(BuildInfo.BuildId));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- CallSiteInfoSym &CallSiteInfo) {
- uint16_t Padding = 0;
-
- error(IO.mapInteger(CallSiteInfo.CodeOffset));
- error(IO.mapInteger(CallSiteInfo.Segment));
- error(IO.mapInteger(Padding));
- error(IO.mapInteger(CallSiteInfo.Type));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- EnvBlockSym &EnvBlock) {
-
- uint8_t Reserved = 0;
- error(IO.mapInteger(Reserved));
- error(IO.mapStringZVectorZ(EnvBlock.Fields));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- FileStaticSym &FileStatic) {
-
- error(IO.mapInteger(FileStatic.Index));
- error(IO.mapInteger(FileStatic.ModFilenameOffset));
- error(IO.mapEnum(FileStatic.Flags));
- error(IO.mapStringZ(FileStatic.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, ExportSym &Export) {
-
- error(IO.mapInteger(Export.Ordinal));
- error(IO.mapEnum(Export.Flags));
- error(IO.mapStringZ(Export.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- Compile2Sym &Compile2) {
-
- error(IO.mapEnum(Compile2.Flags));
- error(IO.mapEnum(Compile2.Machine));
- error(IO.mapInteger(Compile2.VersionFrontendMajor));
- error(IO.mapInteger(Compile2.VersionFrontendMinor));
- error(IO.mapInteger(Compile2.VersionFrontendBuild));
- error(IO.mapInteger(Compile2.VersionBackendMajor));
- error(IO.mapInteger(Compile2.VersionBackendMinor));
- error(IO.mapInteger(Compile2.VersionBackendBuild));
- error(IO.mapStringZ(Compile2.Version));
- error(IO.mapStringZVectorZ(Compile2.ExtraStrings));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- Compile3Sym &Compile3) {
-
- error(IO.mapEnum(Compile3.Flags));
- error(IO.mapEnum(Compile3.Machine));
- error(IO.mapInteger(Compile3.VersionFrontendMajor));
- error(IO.mapInteger(Compile3.VersionFrontendMinor));
- error(IO.mapInteger(Compile3.VersionFrontendBuild));
- error(IO.mapInteger(Compile3.VersionFrontendQFE));
- error(IO.mapInteger(Compile3.VersionBackendMajor));
- error(IO.mapInteger(Compile3.VersionBackendMinor));
- error(IO.mapInteger(Compile3.VersionBackendBuild));
- error(IO.mapInteger(Compile3.VersionBackendQFE));
- error(IO.mapStringZ(Compile3.Version));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- ConstantSym &Constant) {
-
- error(IO.mapInteger(Constant.Type));
- error(IO.mapEncodedInteger(Constant.Value));
- error(IO.mapStringZ(Constant.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, DataSym &Data) {
-
- error(IO.mapInteger(Data.Type));
- error(IO.mapInteger(Data.DataOffset));
- error(IO.mapInteger(Data.Segment));
- error(IO.mapStringZ(Data.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, DefRangeFramePointerRelSym &DefRangeFramePointerRel) {
-
- error(IO.mapInteger(DefRangeFramePointerRel.Offset));
- error(mapLocalVariableAddrRange(IO, DefRangeFramePointerRel.Range));
- error(IO.mapVectorTail(DefRangeFramePointerRel.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR,
- DefRangeFramePointerRelFullScopeSym &DefRangeFramePointerRelFullScope) {
-
- error(IO.mapInteger(DefRangeFramePointerRelFullScope.Offset));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, DefRangeRegisterRelSym &DefRangeRegisterRel) {
-
- error(IO.mapObject(DefRangeRegisterRel.Hdr.Register));
- error(IO.mapObject(DefRangeRegisterRel.Hdr.Flags));
- error(IO.mapObject(DefRangeRegisterRel.Hdr.BasePointerOffset));
- error(mapLocalVariableAddrRange(IO, DefRangeRegisterRel.Range));
- error(IO.mapVectorTail(DefRangeRegisterRel.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, DefRangeRegisterSym &DefRangeRegister) {
-
- error(IO.mapObject(DefRangeRegister.Hdr.Register));
- error(IO.mapObject(DefRangeRegister.Hdr.MayHaveNoName));
- error(mapLocalVariableAddrRange(IO, DefRangeRegister.Range));
- error(IO.mapVectorTail(DefRangeRegister.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, DefRangeSubfieldRegisterSym &DefRangeSubfieldRegister) {
-
- error(IO.mapObject(DefRangeSubfieldRegister.Hdr.Register));
- error(IO.mapObject(DefRangeSubfieldRegister.Hdr.MayHaveNoName));
- error(IO.mapObject(DefRangeSubfieldRegister.Hdr.OffsetInParent));
- error(mapLocalVariableAddrRange(IO, DefRangeSubfieldRegister.Range));
- error(IO.mapVectorTail(DefRangeSubfieldRegister.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, DefRangeSubfieldSym &DefRangeSubfield) {
-
- error(IO.mapInteger(DefRangeSubfield.Program));
- error(IO.mapInteger(DefRangeSubfield.OffsetInParent));
- error(mapLocalVariableAddrRange(IO, DefRangeSubfield.Range));
- error(IO.mapVectorTail(DefRangeSubfield.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- DefRangeSym &DefRange) {
-
- error(IO.mapInteger(DefRange.Program));
- error(mapLocalVariableAddrRange(IO, DefRange.Range));
- error(IO.mapVectorTail(DefRange.Gaps, MapGap()));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- FrameCookieSym &FrameCookie) {
-
- error(IO.mapInteger(FrameCookie.CodeOffset));
- error(IO.mapInteger(FrameCookie.Register));
- error(IO.mapInteger(FrameCookie.CookieKind));
- error(IO.mapInteger(FrameCookie.Flags));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- FrameProcSym &FrameProc) {
- error(IO.mapInteger(FrameProc.TotalFrameBytes));
- error(IO.mapInteger(FrameProc.PaddingFrameBytes));
- error(IO.mapInteger(FrameProc.OffsetToPadding));
- error(IO.mapInteger(FrameProc.BytesOfCalleeSavedRegisters));
- error(IO.mapInteger(FrameProc.OffsetOfExceptionHandler));
- error(IO.mapInteger(FrameProc.SectionIdOfExceptionHandler));
- error(IO.mapEnum(FrameProc.Flags));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(
- CVSymbol &CVR, HeapAllocationSiteSym &HeapAllocSite) {
-
- error(IO.mapInteger(HeapAllocSite.CodeOffset));
- error(IO.mapInteger(HeapAllocSite.Segment));
- error(IO.mapInteger(HeapAllocSite.CallInstructionSize));
- error(IO.mapInteger(HeapAllocSite.Type));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- InlineSiteSym &InlineSite) {
-
- error(IO.mapInteger(InlineSite.Parent));
- error(IO.mapInteger(InlineSite.End));
- error(IO.mapInteger(InlineSite.Inlinee));
- error(IO.mapByteVectorTail(InlineSite.AnnotationData));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- RegisterSym &Register) {
-
- error(IO.mapInteger(Register.Index));
- error(IO.mapEnum(Register.Register));
- error(IO.mapStringZ(Register.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- PublicSym32 &Public) {
-
- error(IO.mapInteger(Public.Index));
- error(IO.mapInteger(Public.Offset));
- error(IO.mapInteger(Public.Segment));
- error(IO.mapStringZ(Public.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- ProcRefSym &ProcRef) {
-
- error(IO.mapInteger(ProcRef.SumName));
- error(IO.mapInteger(ProcRef.SymOffset));
- error(IO.mapInteger(ProcRef.Module));
- error(IO.mapStringZ(ProcRef.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, LabelSym &Label) {
-
- error(IO.mapInteger(Label.CodeOffset));
- error(IO.mapInteger(Label.Segment));
- error(IO.mapEnum(Label.Flags));
- error(IO.mapStringZ(Label.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, LocalSym &Local) {
- error(IO.mapInteger(Local.Type));
- error(IO.mapEnum(Local.Flags));
- error(IO.mapStringZ(Local.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- ObjNameSym &ObjName) {
-
- error(IO.mapInteger(ObjName.Signature));
- error(IO.mapStringZ(ObjName.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, ProcSym &Proc) {
- error(IO.mapInteger(Proc.Parent));
- error(IO.mapInteger(Proc.End));
- error(IO.mapInteger(Proc.Next));
- error(IO.mapInteger(Proc.CodeSize));
- error(IO.mapInteger(Proc.DbgStart));
- error(IO.mapInteger(Proc.DbgEnd));
- error(IO.mapInteger(Proc.FunctionType));
- error(IO.mapInteger(Proc.CodeOffset));
- error(IO.mapInteger(Proc.Segment));
- error(IO.mapEnum(Proc.Flags));
- error(IO.mapStringZ(Proc.Name));
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- ScopeEndSym &ScopeEnd) {
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, CallerSym &Caller) {
- error(IO.mapVectorN<uint32_t>(
- Caller.Indices,
- [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); }));
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- RegRelativeSym &RegRel) {
-
- error(IO.mapInteger(RegRel.Offset));
- error(IO.mapInteger(RegRel.Type));
- error(IO.mapInteger(RegRel.Register));
- error(IO.mapStringZ(RegRel.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR,
- ThreadLocalDataSym &Data) {
-
- error(IO.mapInteger(Data.Type));
- error(IO.mapInteger(Data.DataOffset));
- error(IO.mapInteger(Data.Segment));
- error(IO.mapStringZ(Data.Name));
-
- return Error::success();
-}
-
-Error SymbolRecordMapping::visitKnownRecord(CVSymbol &CVR, UDTSym &UDT) {
-
- error(IO.mapInteger(UDT.Type));
- error(IO.mapStringZ(UDT.Name));
-
- return Error::success();
-}
Removed: llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp?rev=289980&view=auto
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/SymbolSerializer.cpp (removed)
@@ -1 +0,0 @@
-#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
\ No newline at end of file
Modified: llvm/trunk/lib/MC/MCCodeView.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCCodeView.cpp?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCCodeView.cpp (original)
+++ llvm/trunk/lib/MC/MCCodeView.cpp Fri Dec 16 13:25:23 2016
@@ -361,9 +361,7 @@ void CodeViewContext::encodeInlineLineTa
// Exit early if our line table would produce an oversized InlineSiteSym
// record. Account for the ChangeCodeLength annotation emitted after the
// loop ends.
- constexpr uint32_t InlineSiteSize = 12;
- constexpr uint32_t AnnotationSize = 8;
- size_t MaxBufferSize = MaxRecordLength - InlineSiteSize - AnnotationSize;
+ size_t MaxBufferSize = MaxRecordLength - sizeof(InlineSiteSym::Hdr) - 8;
if (Buffer.size() >= MaxBufferSize)
break;
Modified: llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdb-yaml-symbols.test Fri Dec 16 13:25:23 2016
@@ -35,8 +35,8 @@ YAML: Signature: 0
YAML: ObjectName: 'd:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj'
YAML: - Kind: S_COMPILE3
YAML: Compile3Sym:
-YAML: Flags: [ SecurityChecks ]
-YAML: Machine: Pentium3
+YAML: Flags: 8193
+YAML: Machine: 7
YAML: FrontendMajor: 18
YAML: FrontendMinor: 0
YAML: FrontendBuild: 31101
@@ -56,7 +56,7 @@ YAML: DbgStart: 3
YAML: DbgEnd: 8
YAML: FunctionType: 4097
YAML: Segment: 1
-YAML: Flags: [ HasFP ]
+YAML: Flags: 1
YAML: DisplayName: main
YAML: - Kind: S_FRAMEPROC
YAML: FrameProcSym:
@@ -66,7 +66,7 @@ YAML: OffsetToPadding: 0
YAML: BytesOfCalleeSavedRegisters: 0
YAML: OffsetOfExceptionHandler: 0
YAML: SectionIdOfExceptionHandler: 0
-YAML: Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ]
+YAML: Flags: 1212928
YAML: - Kind: S_END
YAML: ScopeEndSym:
YAML: - Kind: S_BUILDINFO
@@ -83,8 +83,8 @@ YAML: Signature: 0
YAML: ObjectName: '* Linker *'
YAML: - Kind: S_COMPILE3
YAML: Compile3Sym:
-YAML: Flags: [ ]
-YAML: Machine: Intel80386
+YAML: Flags: 7
+YAML: Machine: 3
YAML: FrontendMajor: 0
YAML: FrontendMinor: 0
YAML: FrontendBuild: 0
@@ -96,6 +96,7 @@ YAML: BackendQFE: 0
YAML: Version: 'Microsoft (R) LINK'
YAML: - Kind: S_ENVBLOCK
YAML: EnvBlockSym:
+YAML: Reserved: 0
YAML: Entries:
YAML: - cwd
YAML: - 'd:\src\llvm\test\DebugInfo\PDB\Inputs'
@@ -105,7 +106,7 @@ YAML: - pdb
YAML: - 'd:\src\llvm\test\DebugInfo\PDB\Inputs\empty.pdb'
YAML: - Kind: S_TRAMPOLINE
YAML: TrampolineSym:
-YAML: Type: TrampIncremental
+YAML: Type: 0
YAML: Size: 5
YAML: ThunkOff: 5
YAML: TargetOff: 16
@@ -115,6 +116,7 @@ YAML: - Kind: S_SEC
YAML: SectionSym:
YAML: SectionNumber: 1
YAML: Alignment: 12
+YAML: Reserved: 0
YAML: Rva: 4096
YAML: Length: 4122
YAML: Characteristics: 1610612768
@@ -130,6 +132,7 @@ YAML: - Kind: S_SEC
YAML: SectionSym:
YAML: SectionNumber: 2
YAML: Alignment: 12
+YAML: Reserved: 0
YAML: Rva: 12288
YAML: Length: 690
YAML: Characteristics: 1073741888
@@ -159,6 +162,7 @@ YAML: - Kind: S_SEC
YAML: SectionSym:
YAML: SectionNumber: 3
YAML: Alignment: 12
+YAML: Reserved: 0
YAML: Rva: 16384
YAML: Length: 4
YAML: Characteristics: 3221225536
@@ -174,6 +178,7 @@ YAML: - Kind: S_SEC
YAML: SectionSym:
YAML: SectionNumber: 4
YAML: Alignment: 12
+YAML: Reserved: 0
YAML: Rva: 20480
YAML: Length: 8
YAML: Characteristics: 1107296320
Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test Fri Dec 16 13:25:23 2016
@@ -417,6 +417,7 @@
; EMPTY-NEXT: }
; EMPTY-NEXT: {
; EMPTY-NEXT: EnvBlock {
+; EMPTY-NEXT: Reserved: 0
; EMPTY-NEXT: Entries [
; EMPTY-NEXT: cwd
; EMPTY-NEXT: d:\src\llvm\test\DebugInfo\PDB\Inputs
@@ -457,6 +458,7 @@
; EMPTY-NEXT: Section {
; EMPTY-NEXT: SectionNumber: 1
; EMPTY-NEXT: Alignment: 12
+; EMPTY-NEXT: Reserved: 0
; EMPTY-NEXT: Rva: 4096
; EMPTY-NEXT: Length: 4122
; EMPTY-NEXT: Characteristics [ (0x60000020)
@@ -492,6 +494,7 @@
; EMPTY-NEXT: Section {
; EMPTY-NEXT: SectionNumber: 2
; EMPTY-NEXT: Alignment: 12
+; EMPTY-NEXT: Reserved: 0
; EMPTY-NEXT: Rva: 12288
; EMPTY-NEXT: Length: 690
; EMPTY-NEXT: Characteristics [ (0x40000040)
@@ -557,6 +560,7 @@
; EMPTY-NEXT: Section {
; EMPTY-NEXT: SectionNumber: 3
; EMPTY-NEXT: Alignment: 12
+; EMPTY-NEXT: Reserved: 0
; EMPTY-NEXT: Rva: 16384
; EMPTY-NEXT: Length: 4
; EMPTY-NEXT: Characteristics [ (0xC0000040)
@@ -592,6 +596,7 @@
; EMPTY-NEXT: Section {
; EMPTY-NEXT: SectionNumber: 4
; EMPTY-NEXT: Alignment: 12
+; EMPTY-NEXT: Reserved: 0
; EMPTY-NEXT: Rva: 20480
; EMPTY-NEXT: Length: 8
; EMPTY-NEXT: Characteristics [ (0x42000040)
@@ -1250,6 +1255,7 @@
; ALL: }
; ALL: {
; ALL: EnvBlock {
+; ALL: Reserved: 0
; ALL: Entries [
; ALL: cwd
; ALL: d:\src\llvm\test\DebugInfo\PDB\Inputs
@@ -1274,6 +1280,7 @@
; ALL: Section {
; ALL: SectionNumber: 1
; ALL: Alignment: 12
+; ALL: Reserved: 0
; ALL: Rva: 4096
; ALL: Length: 4122
; ALL: Characteristics [ (0x60000020)
@@ -1301,6 +1308,7 @@
; ALL: Section {
; ALL: SectionNumber: 2
; ALL: Alignment: 12
+; ALL: Reserved: 0
; ALL: Rva: 12288
; ALL: Length: 690
; ALL: Characteristics [ (0x40000040)
@@ -1350,6 +1358,7 @@
; ALL: Section {
; ALL: SectionNumber: 3
; ALL: Alignment: 12
+; ALL: Reserved: 0
; ALL: Rva: 16384
; ALL: Length: 4
; ALL: Characteristics [ (0xC0000040)
@@ -1377,6 +1386,7 @@
; ALL: Section {
; ALL: SectionNumber: 4
; ALL: Alignment: 12
+; ALL: Reserved: 0
; ALL: Rva: 20480
; ALL: Length: 8
; ALL: Characteristics [ (0x42000040)
Modified: llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp?rev=289981&r1=289980&r2=289981&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp Fri Dec 16 13:25:23 2016
@@ -38,197 +38,105 @@ void ScalarEnumerationTraits<SymbolKind>
io.enumCase(Value, E.Name.str().c_str(), E.Value);
}
-template <> struct ScalarBitSetTraits<CompileSym2Flags> {
- static void bitset(IO &io, CompileSym2Flags &Flags) {
- auto FlagNames = getCompileSym2FlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<CompileSym2Flags>(E.Value));
- }
- }
-};
-
-template <> struct ScalarBitSetTraits<CompileSym3Flags> {
- static void bitset(IO &io, CompileSym3Flags &Flags) {
- auto FlagNames = getCompileSym3FlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<CompileSym3Flags>(E.Value));
- }
- }
-};
-
-template <> struct ScalarBitSetTraits<ExportFlags> {
- static void bitset(IO &io, ExportFlags &Flags) {
- auto FlagNames = getExportSymFlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<ExportFlags>(E.Value));
- }
- }
-};
-
-template <> struct ScalarBitSetTraits<LocalSymFlags> {
- static void bitset(IO &io, LocalSymFlags &Flags) {
- auto FlagNames = getLocalFlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<LocalSymFlags>(E.Value));
- }
- }
-};
-
-template <> struct ScalarBitSetTraits<ProcSymFlags> {
- static void bitset(IO &io, ProcSymFlags &Flags) {
- auto FlagNames = getProcSymFlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<ProcSymFlags>(E.Value));
- }
- }
-};
-
-template <> struct ScalarBitSetTraits<FrameProcedureOptions> {
- static void bitset(IO &io, FrameProcedureOptions &Flags) {
- auto FlagNames = getFrameProcSymFlagNames();
- for (const auto &E : FlagNames) {
- io.bitSetCase(Flags, E.Name.str().c_str(),
- static_cast<FrameProcedureOptions>(E.Value));
- }
- }
-};
-
-template <> struct ScalarEnumerationTraits<CPUType> {
- static void enumeration(IO &io, CPUType &Cpu) {
- auto CpuNames = getCPUTypeNames();
- for (const auto &E : CpuNames) {
- io.enumCase(Cpu, E.Name.str().c_str(), static_cast<CPUType>(E.Value));
- }
- }
-};
-
-template <> struct ScalarEnumerationTraits<RegisterId> {
- static void enumeration(IO &io, RegisterId &Reg) {
- auto RegNames = getRegisterNames();
- for (const auto &E : RegNames) {
- io.enumCase(Reg, E.Name.str().c_str(), static_cast<RegisterId>(E.Value));
- }
- }
-};
-
-template <> struct ScalarEnumerationTraits<TrampolineType> {
- static void enumeration(IO &io, TrampolineType &Tramp) {
- auto TrampNames = getTrampolineNames();
- for (const auto &E : TrampNames) {
- io.enumCase(Tramp, E.Name.str().c_str(),
- static_cast<TrampolineType>(E.Value));
- }
- }
-};
-
template <> struct ScalarEnumerationTraits<ThunkOrdinal> {
- static void enumeration(IO &io, ThunkOrdinal &Ord) {
- auto ThunkNames = getThunkOrdinalNames();
- for (const auto &E : ThunkNames) {
- io.enumCase(Ord, E.Name.str().c_str(),
- static_cast<ThunkOrdinal>(E.Value));
- }
- }
+ void enumeration(IO &io, ThunkOrdinal Ord) {}
};
void MappingTraits<ScopeEndSym>::mapping(IO &IO, ScopeEndSym &Obj) {}
void MappingTraits<Thunk32Sym>::mapping(IO &IO, Thunk32Sym &Thunk) {
- IO.mapRequired("Parent", Thunk.Parent);
- IO.mapRequired("End", Thunk.End);
- IO.mapRequired("Next", Thunk.Next);
- IO.mapRequired("Off", Thunk.Offset);
- IO.mapRequired("Seg", Thunk.Segment);
- IO.mapRequired("Len", Thunk.Length);
- IO.mapRequired("Ordinal", Thunk.Thunk);
+ IO.mapRequired("Parent", Thunk.Header.Parent);
+ IO.mapRequired("End", Thunk.Header.End);
+ IO.mapRequired("Next", Thunk.Header.Next);
+ IO.mapRequired("Off", Thunk.Header.Off);
+ IO.mapRequired("Seg", Thunk.Header.Seg);
+ IO.mapRequired("Len", Thunk.Header.Len);
+ IO.mapRequired("Ordinal", Thunk.Header.Ord);
}
void MappingTraits<TrampolineSym>::mapping(IO &IO, TrampolineSym &Tramp) {
- IO.mapRequired("Type", Tramp.Type);
- IO.mapRequired("Size", Tramp.Size);
- IO.mapRequired("ThunkOff", Tramp.ThunkOffset);
- IO.mapRequired("TargetOff", Tramp.TargetOffset);
- IO.mapRequired("ThunkSection", Tramp.ThunkSection);
- IO.mapRequired("TargetSection", Tramp.TargetSection);
+ IO.mapRequired("Type", Tramp.Header.Type);
+ IO.mapRequired("Size", Tramp.Header.Size);
+ IO.mapRequired("ThunkOff", Tramp.Header.ThunkOff);
+ IO.mapRequired("TargetOff", Tramp.Header.TargetOff);
+ IO.mapRequired("ThunkSection", Tramp.Header.ThunkSection);
+ IO.mapRequired("TargetSection", Tramp.Header.TargetSection);
}
void MappingTraits<SectionSym>::mapping(IO &IO, SectionSym &Section) {
- IO.mapRequired("SectionNumber", Section.SectionNumber);
- IO.mapRequired("Alignment", Section.Alignment);
- IO.mapRequired("Rva", Section.Rva);
- IO.mapRequired("Length", Section.Length);
- IO.mapRequired("Characteristics", Section.Characteristics);
+ IO.mapRequired("SectionNumber", Section.Header.SectionNumber);
+ IO.mapRequired("Alignment", Section.Header.Alignment);
+ IO.mapRequired("Reserved", Section.Header.Reserved);
+ IO.mapRequired("Rva", Section.Header.Rva);
+ IO.mapRequired("Length", Section.Header.Length);
+ IO.mapRequired("Characteristics", Section.Header.Characteristics);
IO.mapRequired("Name", Section.Name);
}
void MappingTraits<CoffGroupSym>::mapping(IO &IO, CoffGroupSym &CoffGroup) {
- IO.mapRequired("Size", CoffGroup.Size);
- IO.mapRequired("Characteristics", CoffGroup.Characteristics);
- IO.mapRequired("Offset", CoffGroup.Offset);
- IO.mapRequired("Segment", CoffGroup.Segment);
+ IO.mapRequired("Size", CoffGroup.Header.Size);
+ IO.mapRequired("Characteristics", CoffGroup.Header.Characteristics);
+ IO.mapRequired("Offset", CoffGroup.Header.Offset);
+ IO.mapRequired("Segment", CoffGroup.Header.Segment);
IO.mapRequired("Name", CoffGroup.Name);
}
void MappingTraits<ExportSym>::mapping(IO &IO, ExportSym &Export) {
- IO.mapRequired("Ordinal", Export.Ordinal);
- IO.mapRequired("Flags", Export.Flags);
+ IO.mapRequired("Ordinal", Export.Header.Ordinal);
+ IO.mapRequired("Flags", Export.Header.Flags);
IO.mapRequired("Name", Export.Name);
}
void MappingTraits<ProcSym>::mapping(IO &IO, ProcSym &Proc) {
// TODO: Print the linkage name
- IO.mapRequired("PtrParent", Proc.Parent);
- IO.mapRequired("PtrEnd", Proc.End);
- IO.mapRequired("PtrNext", Proc.Next);
- IO.mapRequired("CodeSize", Proc.CodeSize);
- IO.mapRequired("DbgStart", Proc.DbgStart);
- IO.mapRequired("DbgEnd", Proc.DbgEnd);
- IO.mapRequired("FunctionType", Proc.FunctionType);
- IO.mapRequired("Segment", Proc.Segment);
- IO.mapRequired("Flags", Proc.Flags);
+ IO.mapRequired("PtrParent", Proc.Header.PtrParent);
+ IO.mapRequired("PtrEnd", Proc.Header.PtrEnd);
+ IO.mapRequired("PtrNext", Proc.Header.PtrNext);
+ IO.mapRequired("CodeSize", Proc.Header.CodeSize);
+ IO.mapRequired("DbgStart", Proc.Header.DbgStart);
+ IO.mapRequired("DbgEnd", Proc.Header.DbgEnd);
+ IO.mapRequired("FunctionType", Proc.Header.FunctionType);
+ IO.mapRequired("Segment", Proc.Header.Segment);
+ IO.mapRequired("Flags", Proc.Header.Flags);
IO.mapRequired("DisplayName", Proc.Name);
}
void MappingTraits<RegisterSym>::mapping(IO &IO, RegisterSym &Register) {
- IO.mapRequired("Type", Register.Index);
- IO.mapRequired("Seg", Register.Register);
+ IO.mapRequired("Type", Register.Header.Index);
+ IO.mapRequired("Seg", Register.Header.Register);
IO.mapRequired("Name", Register.Name);
}
void MappingTraits<PublicSym32>::mapping(IO &IO, PublicSym32 &Public) {
- IO.mapRequired("Type", Public.Index);
- IO.mapRequired("Seg", Public.Segment);
- IO.mapRequired("Off", Public.Offset);
+ IO.mapRequired("Type", Public.Header.Index);
+ IO.mapRequired("Seg", Public.Header.Seg);
+ IO.mapRequired("Off", Public.Header.Off);
IO.mapRequired("Name", Public.Name);
}
void MappingTraits<ProcRefSym>::mapping(IO &IO, ProcRefSym &ProcRef) {
- IO.mapRequired("SumName", ProcRef.SumName);
- IO.mapRequired("SymOffset", ProcRef.SymOffset);
- IO.mapRequired("Mod", ProcRef.Module);
+ IO.mapRequired("SumName", ProcRef.Header.SumName);
+ IO.mapRequired("SymOffset", ProcRef.Header.SymOffset);
+ IO.mapRequired("Mod", ProcRef.Header.Mod);
IO.mapRequired("Name", ProcRef.Name);
}
void MappingTraits<EnvBlockSym>::mapping(IO &IO, EnvBlockSym &EnvBlock) {
+ IO.mapRequired("Reserved", EnvBlock.Header.Reserved);
IO.mapRequired("Entries", EnvBlock.Fields);
}
void MappingTraits<InlineSiteSym>::mapping(IO &IO, InlineSiteSym &InlineSite) {
- IO.mapRequired("PtrParent", InlineSite.Parent);
- IO.mapRequired("PtrEnd", InlineSite.End);
- IO.mapRequired("Inlinee", InlineSite.Inlinee);
+ IO.mapRequired("PtrParent", InlineSite.Header.PtrParent);
+ IO.mapRequired("PtrEnd", InlineSite.Header.PtrEnd);
+ IO.mapRequired("Inlinee", InlineSite.Header.Inlinee);
// TODO: The binary annotations
}
void MappingTraits<LocalSym>::mapping(IO &IO, LocalSym &Local) {
- IO.mapRequired("Type", Local.Type);
- IO.mapRequired("Flags", Local.Flags);
+ IO.mapRequired("Type", Local.Header.Type);
+ IO.mapRequired("Flags", Local.Header.Flags);
IO.mapRequired("VarName", Local.Name);
}
@@ -268,93 +176,95 @@ void MappingTraits<DefRangeRegisterRelSy
void MappingTraits<BlockSym>::mapping(IO &IO, BlockSym &Block) {
// TODO: Print the linkage name
- IO.mapRequired("PtrParent", Block.Parent);
- IO.mapRequired("PtrEnd", Block.End);
- IO.mapRequired("CodeSize", Block.CodeSize);
- IO.mapRequired("Segment", Block.Segment);
+ IO.mapRequired("PtrParent", Block.Header.PtrParent);
+ IO.mapRequired("PtrEnd", Block.Header.PtrEnd);
+ IO.mapRequired("CodeSize", Block.Header.CodeSize);
+ IO.mapRequired("Segment", Block.Header.Segment);
IO.mapRequired("BlockName", Block.Name);
}
void MappingTraits<LabelSym>::mapping(IO &IO, LabelSym &Label) {
// TODO: Print the linkage name
- IO.mapRequired("Segment", Label.Segment);
- IO.mapRequired("Flags", Label.Flags);
- IO.mapRequired("Flags", Label.Flags);
+ IO.mapRequired("Segment", Label.Header.Segment);
+ IO.mapRequired("Flags", Label.Header.Flags);
+ IO.mapRequired("Flags", Label.Header.Flags);
IO.mapRequired("DisplayName", Label.Name);
}
void MappingTraits<ObjNameSym>::mapping(IO &IO, ObjNameSym &ObjName) {
- IO.mapRequired("Signature", ObjName.Signature);
+ IO.mapRequired("Signature", ObjName.Header.Signature);
IO.mapRequired("ObjectName", ObjName.Name);
}
void MappingTraits<Compile2Sym>::mapping(IO &IO, Compile2Sym &Compile2) {
- IO.mapRequired("Flags", Compile2.Flags);
- IO.mapRequired("Machine", Compile2.Machine);
- IO.mapRequired("FrontendMajor", Compile2.VersionFrontendMajor);
- IO.mapRequired("FrontendMinor", Compile2.VersionFrontendMinor);
- IO.mapRequired("FrontendBuild", Compile2.VersionFrontendBuild);
- IO.mapRequired("BackendMajor", Compile2.VersionBackendMajor);
- IO.mapRequired("BackendMinor", Compile2.VersionBackendMinor);
- IO.mapRequired("BackendBuild", Compile2.VersionBackendBuild);
+ IO.mapRequired("Flags", Compile2.Header.flags);
+ IO.mapRequired("Machine", Compile2.Header.Machine);
+ IO.mapRequired("FrontendMajor", Compile2.Header.VersionFrontendMajor);
+ IO.mapRequired("FrontendMinor", Compile2.Header.VersionFrontendMinor);
+ IO.mapRequired("FrontendBuild", Compile2.Header.VersionFrontendBuild);
+ IO.mapRequired("BackendMajor", Compile2.Header.VersionBackendMajor);
+ IO.mapRequired("BackendMinor", Compile2.Header.VersionBackendMinor);
+ IO.mapRequired("BackendBuild", Compile2.Header.VersionBackendBuild);
IO.mapRequired("Version", Compile2.Version);
}
void MappingTraits<Compile3Sym>::mapping(IO &IO, Compile3Sym &Compile3) {
- IO.mapRequired("Flags", Compile3.Flags);
- IO.mapRequired("Machine", Compile3.Machine);
- IO.mapRequired("FrontendMajor", Compile3.VersionFrontendMajor);
- IO.mapRequired("FrontendMinor", Compile3.VersionFrontendMinor);
- IO.mapRequired("FrontendBuild", Compile3.VersionFrontendBuild);
- IO.mapRequired("FrontendQFE", Compile3.VersionFrontendQFE);
- IO.mapRequired("BackendMajor", Compile3.VersionBackendMajor);
- IO.mapRequired("BackendMinor", Compile3.VersionBackendMinor);
- IO.mapRequired("BackendBuild", Compile3.VersionBackendBuild);
- IO.mapRequired("BackendQFE", Compile3.VersionBackendQFE);
+ IO.mapRequired("Flags", Compile3.Header.flags);
+ IO.mapRequired("Machine", Compile3.Header.Machine);
+ IO.mapRequired("FrontendMajor", Compile3.Header.VersionFrontendMajor);
+ IO.mapRequired("FrontendMinor", Compile3.Header.VersionFrontendMinor);
+ IO.mapRequired("FrontendBuild", Compile3.Header.VersionFrontendBuild);
+ IO.mapRequired("FrontendQFE", Compile3.Header.VersionFrontendQFE);
+ IO.mapRequired("BackendMajor", Compile3.Header.VersionBackendMajor);
+ IO.mapRequired("BackendMinor", Compile3.Header.VersionBackendMinor);
+ IO.mapRequired("BackendBuild", Compile3.Header.VersionBackendBuild);
+ IO.mapRequired("BackendQFE", Compile3.Header.VersionBackendQFE);
IO.mapRequired("Version", Compile3.Version);
}
void MappingTraits<FrameProcSym>::mapping(IO &IO, FrameProcSym &FrameProc) {
- IO.mapRequired("TotalFrameBytes", FrameProc.TotalFrameBytes);
- IO.mapRequired("PaddingFrameBytes", FrameProc.PaddingFrameBytes);
- IO.mapRequired("OffsetToPadding", FrameProc.OffsetToPadding);
+ IO.mapRequired("TotalFrameBytes", FrameProc.Header.TotalFrameBytes);
+ IO.mapRequired("PaddingFrameBytes", FrameProc.Header.PaddingFrameBytes);
+ IO.mapRequired("OffsetToPadding", FrameProc.Header.OffsetToPadding);
IO.mapRequired("BytesOfCalleeSavedRegisters",
- FrameProc.BytesOfCalleeSavedRegisters);
+ FrameProc.Header.BytesOfCalleeSavedRegisters);
IO.mapRequired("OffsetOfExceptionHandler",
- FrameProc.OffsetOfExceptionHandler);
+ FrameProc.Header.OffsetOfExceptionHandler);
IO.mapRequired("SectionIdOfExceptionHandler",
- FrameProc.SectionIdOfExceptionHandler);
- IO.mapRequired("Flags", FrameProc.Flags);
+ FrameProc.Header.SectionIdOfExceptionHandler);
+ IO.mapRequired("Flags", FrameProc.Header.Flags);
}
void MappingTraits<CallSiteInfoSym>::mapping(IO &IO,
CallSiteInfoSym &CallSiteInfo) {
// TODO: Map Linkage Name
- IO.mapRequired("Segment", CallSiteInfo.Segment);
- IO.mapRequired("Type", CallSiteInfo.Type);
+ IO.mapRequired("Segment", CallSiteInfo.Header.Segment);
+ IO.mapRequired("Reserved", CallSiteInfo.Header.Reserved);
+ IO.mapRequired("Type", CallSiteInfo.Header.Type);
}
void MappingTraits<FileStaticSym>::mapping(IO &IO, FileStaticSym &FileStatic) {
- IO.mapRequired("Index", FileStatic.Index);
- IO.mapRequired("ModFilenameOffset", FileStatic.ModFilenameOffset);
- IO.mapRequired("Flags", FileStatic.Flags);
+ IO.mapRequired("Index", FileStatic.Header.Index);
+ IO.mapRequired("ModFilenameOffset", FileStatic.Header.ModFilenameOffset);
+ IO.mapRequired("Flags", FileStatic.Header.Flags);
IO.mapRequired("Name", FileStatic.Name);
}
void MappingTraits<HeapAllocationSiteSym>::mapping(
IO &IO, HeapAllocationSiteSym &HeapAllocSite) {
// TODO: Map Linkage Name
- IO.mapRequired("Segment", HeapAllocSite.Segment);
- IO.mapRequired("CallInstructionSize", HeapAllocSite.CallInstructionSize);
- IO.mapRequired("Type", HeapAllocSite.Type);
+ IO.mapRequired("Segment", HeapAllocSite.Header.Segment);
+ IO.mapRequired("CallInstructionSize",
+ HeapAllocSite.Header.CallInstructionSize);
+ IO.mapRequired("Type", HeapAllocSite.Header.Type);
}
void MappingTraits<FrameCookieSym>::mapping(IO &IO,
FrameCookieSym &FrameCookie) {
// TODO: Map Linkage Name
- IO.mapRequired("Register", FrameCookie.Register);
- IO.mapRequired("CookieKind", FrameCookie.CookieKind);
- IO.mapRequired("Flags", FrameCookie.Flags);
+ IO.mapRequired("Register", FrameCookie.Header.Register);
+ IO.mapRequired("CookieKind", FrameCookie.Header.CookieKind);
+ IO.mapRequired("Flags", FrameCookie.Header.Flags);
}
void MappingTraits<CallerSym>::mapping(IO &IO, CallerSym &Caller) {
@@ -364,43 +274,43 @@ void MappingTraits<CallerSym>::mapping(I
}
void MappingTraits<UDTSym>::mapping(IO &IO, UDTSym &UDT) {
- IO.mapRequired("Type", UDT.Type);
+ IO.mapRequired("Type", UDT.Header.Type);
IO.mapRequired("UDTName", UDT.Name);
}
void MappingTraits<BuildInfoSym>::mapping(IO &IO, BuildInfoSym &BuildInfo) {
- IO.mapRequired("BuildId", BuildInfo.BuildId);
+ IO.mapRequired("BuildId", BuildInfo.Header.BuildId);
}
void MappingTraits<BPRelativeSym>::mapping(IO &IO, BPRelativeSym &BPRel) {
- IO.mapRequired("Offset", BPRel.Offset);
- IO.mapRequired("Type", BPRel.Type);
+ IO.mapRequired("Offset", BPRel.Header.Offset);
+ IO.mapRequired("Type", BPRel.Header.Type);
IO.mapRequired("VarName", BPRel.Name);
}
void MappingTraits<RegRelativeSym>::mapping(IO &IO, RegRelativeSym &RegRel) {
- IO.mapRequired("Offset", RegRel.Offset);
- IO.mapRequired("Type", RegRel.Type);
- IO.mapRequired("Register", RegRel.Register);
+ IO.mapRequired("Offset", RegRel.Header.Offset);
+ IO.mapRequired("Type", RegRel.Header.Type);
+ IO.mapRequired("Register", RegRel.Header.Register);
IO.mapRequired("VarName", RegRel.Name);
}
void MappingTraits<ConstantSym>::mapping(IO &IO, ConstantSym &Constant) {
- IO.mapRequired("Type", Constant.Type);
+ IO.mapRequired("Type", Constant.Header.Type);
IO.mapRequired("Value", Constant.Value);
IO.mapRequired("Name", Constant.Name);
}
void MappingTraits<DataSym>::mapping(IO &IO, DataSym &Data) {
// TODO: Map linkage name
- IO.mapRequired("Type", Data.Type);
+ IO.mapRequired("Type", Data.Header.Type);
IO.mapRequired("DisplayName", Data.Name);
}
void MappingTraits<ThreadLocalDataSym>::mapping(IO &IO,
ThreadLocalDataSym &Data) {
// TODO: Map linkage name
- IO.mapRequired("Type", Data.Type);
+ IO.mapRequired("Type", Data.Header.Type);
IO.mapRequired("DisplayName", Data.Name);
}
}
More information about the llvm-commits
mailing list