diff options
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp | 54 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp | 228 |
2 files changed, 157 insertions, 125 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp index 2b69a1e0768..2f49474115a 100644 --- a/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +++ b/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp @@ -97,8 +97,10 @@ Error CodeViewRecordIO::skipPadding() { return Reader->skip(BytesToAdvance); } -Error CodeViewRecordIO::mapByteVectorTail(ArrayRef<uint8_t> &Bytes) { +Error CodeViewRecordIO::mapByteVectorTail(ArrayRef<uint8_t> &Bytes, + const Twine &Comment) { if (isStreaming()) { + emitComment(Comment); Streamer->EmitBinaryData(toStringRef(Bytes)); incrStreamedLen(Bytes.size()); } else if (isWriting()) { @@ -111,9 +113,10 @@ Error CodeViewRecordIO::mapByteVectorTail(ArrayRef<uint8_t> &Bytes) { return Error::success(); } -Error CodeViewRecordIO::mapByteVectorTail(std::vector<uint8_t> &Bytes) { +Error CodeViewRecordIO::mapByteVectorTail(std::vector<uint8_t> &Bytes, + const Twine &Comment) { ArrayRef<uint8_t> BytesRef(Bytes); - if (auto EC = mapByteVectorTail(BytesRef)) + if (auto EC = mapByteVectorTail(BytesRef, Comment)) return EC; if (!isWriting()) Bytes.assign(BytesRef.begin(), BytesRef.end()); @@ -121,8 +124,9 @@ Error CodeViewRecordIO::mapByteVectorTail(std::vector<uint8_t> &Bytes) { return Error::success(); } -Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd) { +Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd, const Twine &Comment) { if (isStreaming()) { + emitComment(Comment); Streamer->EmitIntValue(TypeInd.getIndex(), sizeof(TypeInd.getIndex())); incrStreamedLen(sizeof(TypeInd.getIndex())); } else if (isWriting()) { @@ -137,12 +141,13 @@ Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd) { return Error::success(); } -Error CodeViewRecordIO::mapEncodedInteger(int64_t &Value) { +Error CodeViewRecordIO::mapEncodedInteger(int64_t &Value, + const Twine &Comment) { if (isStreaming()) { if (Value >= 0) - emitEncodedUnsignedInteger(static_cast<uint64_t>(Value)); + emitEncodedUnsignedInteger(static_cast<uint64_t>(Value), Comment); else - emitEncodedSignedInteger(Value); + emitEncodedSignedInteger(Value, Comment); } else if (isWriting()) { if (Value >= 0) { if (auto EC = writeEncodedUnsignedInteger(static_cast<uint64_t>(Value))) @@ -161,9 +166,10 @@ Error CodeViewRecordIO::mapEncodedInteger(int64_t &Value) { return Error::success(); } -Error CodeViewRecordIO::mapEncodedInteger(uint64_t &Value) { +Error CodeViewRecordIO::mapEncodedInteger(uint64_t &Value, + const Twine &Comment) { if (isStreaming()) - emitEncodedUnsignedInteger(Value); + emitEncodedUnsignedInteger(Value, Comment); else if (isWriting()) { if (auto EC = writeEncodedUnsignedInteger(Value)) return EC; @@ -176,12 +182,12 @@ Error CodeViewRecordIO::mapEncodedInteger(uint64_t &Value) { return Error::success(); } -Error CodeViewRecordIO::mapEncodedInteger(APSInt &Value) { +Error CodeViewRecordIO::mapEncodedInteger(APSInt &Value, const Twine &Comment) { if (isStreaming()) { if (Value.isSigned()) - emitEncodedSignedInteger(Value.getSExtValue()); + emitEncodedSignedInteger(Value.getSExtValue(), Comment); else - emitEncodedUnsignedInteger(Value.getZExtValue()); + emitEncodedUnsignedInteger(Value.getZExtValue(), Comment); } else if (isWriting()) { if (Value.isSigned()) return writeEncodedSignedInteger(Value.getSExtValue()); @@ -191,9 +197,10 @@ Error CodeViewRecordIO::mapEncodedInteger(APSInt &Value) { return Error::success(); } -Error CodeViewRecordIO::mapStringZ(StringRef &Value) { +Error CodeViewRecordIO::mapStringZ(StringRef &Value, const Twine &Comment) { if (isStreaming()) { auto NullTerminatedString = StringRef(Value.data(), Value.size() + 1); + emitComment(Comment); Streamer->EmitBytes(NullTerminatedString); incrStreamedLen(NullTerminatedString.size()); } else if (isWriting()) { @@ -208,12 +215,13 @@ Error CodeViewRecordIO::mapStringZ(StringRef &Value) { return Error::success(); } -Error CodeViewRecordIO::mapGuid(GUID &Guid) { +Error CodeViewRecordIO::mapGuid(GUID &Guid, const Twine &Comment) { constexpr uint32_t GuidSize = 16; if (isStreaming()) { StringRef GuidSR = StringRef((reinterpret_cast<const char *>(&Guid)), GuidSize); + emitComment(Comment); Streamer->EmitBytes(GuidSR); incrStreamedLen(GuidSize); return Error::success(); @@ -234,9 +242,11 @@ Error CodeViewRecordIO::mapGuid(GUID &Guid) { return Error::success(); } -Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value) { +Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value, + const Twine &Comment) { if (!isReading()) { + emitComment(Comment); for (auto V : Value) { if (auto EC = mapStringZ(V)) return EC; @@ -257,41 +267,51 @@ Error CodeViewRecordIO::mapStringZVectorZ(std::vector<StringRef> &Value) { return Error::success(); } -void CodeViewRecordIO::emitEncodedSignedInteger(const int64_t &Value) { +void CodeViewRecordIO::emitEncodedSignedInteger(const int64_t &Value, + const Twine &Comment) { assert(Value < 0 && "Encoded integer is not signed!"); if (Value >= std::numeric_limits<int8_t>::min()) { Streamer->EmitIntValue(LF_CHAR, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 1); incrStreamedLen(3); } else if (Value >= std::numeric_limits<int16_t>::min()) { Streamer->EmitIntValue(LF_SHORT, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 2); incrStreamedLen(4); } else if (Value >= std::numeric_limits<int32_t>::min()) { Streamer->EmitIntValue(LF_LONG, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 4); incrStreamedLen(6); } else { Streamer->EmitIntValue(LF_QUADWORD, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 4); incrStreamedLen(6); } } -void CodeViewRecordIO::emitEncodedUnsignedInteger(const uint64_t &Value) { +void CodeViewRecordIO::emitEncodedUnsignedInteger(const uint64_t &Value, + const Twine &Comment) { if (Value < LF_NUMERIC) { + emitComment(Comment); Streamer->EmitIntValue(Value, 2); incrStreamedLen(2); } else if (Value <= std::numeric_limits<uint16_t>::max()) { Streamer->EmitIntValue(LF_USHORT, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 2); incrStreamedLen(4); } else if (Value <= std::numeric_limits<uint32_t>::max()) { Streamer->EmitIntValue(LF_ULONG, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 4); incrStreamedLen(6); } else { Streamer->EmitIntValue(LF_UQUADWORD, 2); + emitComment(Comment); Streamer->EmitIntValue(Value, 8); incrStreamedLen(6); } diff --git a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp index 104e310d41b..8e8eba4d53e 100644 --- a/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +++ b/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp @@ -21,19 +21,19 @@ struct MapOneMethodRecord { : IsFromOverloadList(IsFromOverloadList) {} Error operator()(CodeViewRecordIO &IO, OneMethodRecord &Method) const { - error(IO.mapInteger(Method.Attrs.Attrs)); + error(IO.mapInteger(Method.Attrs.Attrs, "AccessSpecifier")); if (IsFromOverloadList) { uint16_t Padding = 0; - error(IO.mapInteger(Padding)); + error(IO.mapInteger(Padding, "Padding")); } - error(IO.mapInteger(Method.Type)); + error(IO.mapInteger(Method.Type, "Type")); if (Method.isIntroducingVirtual()) { - error(IO.mapInteger(Method.VFTableOffset)); + error(IO.mapInteger(Method.VFTableOffset, "VFTableOffset")); } else if (IO.isReading()) Method.VFTableOffset = -1; if (!IsFromOverloadList) - error(IO.mapStringZ(Method.Name)); + error(IO.mapStringZ(Method.Name, "Name")); return Error::success(); } @@ -75,9 +75,9 @@ static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name, // Reading & Streaming mode come after writing mode is executed for each // record. Truncating large names are done during writing, so its not // necessary to do it while reading or streaming. - error(IO.mapStringZ(Name)); + error(IO.mapStringZ(Name, "Name")); if (HasUniqueName) - error(IO.mapStringZ(UniqueName)); + error(IO.mapStringZ(UniqueName, "LinkageName")); } return Error::success(); @@ -144,32 +144,32 @@ Error TypeRecordMapping::visitMemberEnd(CVMemberRecord &Record) { } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) { - error(IO.mapInteger(Record.ModifiedType)); - error(IO.mapEnum(Record.Modifiers)); + error(IO.mapInteger(Record.ModifiedType, "ModifiedType")); + error(IO.mapEnum(Record.Modifiers, "Modifiers")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ProcedureRecord &Record) { - error(IO.mapInteger(Record.ReturnType)); - error(IO.mapEnum(Record.CallConv)); - error(IO.mapEnum(Record.Options)); - error(IO.mapInteger(Record.ParameterCount)); - error(IO.mapInteger(Record.ArgumentList)); + error(IO.mapInteger(Record.ReturnType, "ReturnType")); + error(IO.mapEnum(Record.CallConv, "CallingConvention")); + error(IO.mapEnum(Record.Options, "FunctionOptions")); + error(IO.mapInteger(Record.ParameterCount, "NumParameters")); + error(IO.mapInteger(Record.ArgumentList, "ArgListType")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, MemberFunctionRecord &Record) { - error(IO.mapInteger(Record.ReturnType)); - error(IO.mapInteger(Record.ClassType)); - error(IO.mapInteger(Record.ThisType)); - error(IO.mapEnum(Record.CallConv)); - error(IO.mapEnum(Record.Options)); - error(IO.mapInteger(Record.ParameterCount)); - error(IO.mapInteger(Record.ArgumentList)); - error(IO.mapInteger(Record.ThisPointerAdjustment)); + error(IO.mapInteger(Record.ReturnType, "ReturnType")); + error(IO.mapInteger(Record.ClassType, "ClassType")); + error(IO.mapInteger(Record.ThisType, "ThisType")); + error(IO.mapEnum(Record.CallConv, "CallingConvention")); + error(IO.mapEnum(Record.Options, "FunctionOptions")); + error(IO.mapInteger(Record.ParameterCount, "NumParameters")); + error(IO.mapInteger(Record.ArgumentList, "ArgListType")); + error(IO.mapInteger(Record.ThisPointerAdjustment, "ThisAdjustment")); return Error::success(); } @@ -177,7 +177,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArgListRecord &Record) { error(IO.mapVectorN<uint32_t>( Record.ArgIndices, - [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); + [](CodeViewRecordIO &IO, TypeIndex &N) { + return IO.mapInteger(N, "Argument"); + }, + "NumArgs")); return Error::success(); } @@ -185,32 +188,35 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, StringListRecord &Record) { error(IO.mapVectorN<uint32_t>( Record.StringIndices, - [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); + [](CodeViewRecordIO &IO, TypeIndex &N) { + return IO.mapInteger(N, "Strings"); + }, + "NumStrings")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, PointerRecord &Record) { - error(IO.mapInteger(Record.ReferentType)); - error(IO.mapInteger(Record.Attrs)); + error(IO.mapInteger(Record.ReferentType, "PointeeType")); + error(IO.mapInteger(Record.Attrs, "Attributes")); if (Record.isPointerToMember()) { if (IO.isReading()) Record.MemberInfo.emplace(); MemberPointerInfo &M = *Record.MemberInfo; - error(IO.mapInteger(M.ContainingType)); - error(IO.mapEnum(M.Representation)); + error(IO.mapInteger(M.ContainingType, "ClassType")); + error(IO.mapEnum(M.Representation, "Representation")); } return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ArrayRecord &Record) { - error(IO.mapInteger(Record.ElementType)); - error(IO.mapInteger(Record.IndexType)); - error(IO.mapEncodedInteger(Record.Size)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.ElementType, "ElementType")); + error(IO.mapInteger(Record.IndexType, "IndexType")); + error(IO.mapEncodedInteger(Record.Size, "SizeOf")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } @@ -220,12 +226,12 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ClassRecord &Record) { (CVR.kind() == TypeLeafKind::LF_CLASS) || (CVR.kind() == TypeLeafKind::LF_INTERFACE)); - error(IO.mapInteger(Record.MemberCount)); - error(IO.mapEnum(Record.Options)); - error(IO.mapInteger(Record.FieldList)); - error(IO.mapInteger(Record.DerivationList)); - error(IO.mapInteger(Record.VTableShape)); - error(IO.mapEncodedInteger(Record.Size)); + error(IO.mapInteger(Record.MemberCount, "MemberCount")); + error(IO.mapEnum(Record.Options, "Properties")); + error(IO.mapInteger(Record.FieldList, "FieldList")); + error(IO.mapInteger(Record.DerivationList, "DerivedFrom")); + error(IO.mapInteger(Record.VTableShape, "VShape")); + error(IO.mapEncodedInteger(Record.Size, "SizeOf")); error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, Record.hasUniqueName())); @@ -233,10 +239,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ClassRecord &Record) { } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) { - error(IO.mapInteger(Record.MemberCount)); - error(IO.mapEnum(Record.Options)); - error(IO.mapInteger(Record.FieldList)); - error(IO.mapEncodedInteger(Record.Size)); + error(IO.mapInteger(Record.MemberCount, "MemberCount")); + error(IO.mapEnum(Record.Options, "Properties")); + error(IO.mapInteger(Record.FieldList, "FieldList")); + error(IO.mapEncodedInteger(Record.Size, "SizeOf")); error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, Record.hasUniqueName())); @@ -244,10 +250,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) { } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) { - error(IO.mapInteger(Record.MemberCount)); - error(IO.mapEnum(Record.Options)); - error(IO.mapInteger(Record.UnderlyingType)); - error(IO.mapInteger(Record.FieldList)); + error(IO.mapInteger(Record.MemberCount, "NumEnumerators")); + error(IO.mapEnum(Record.Options, "Properties")); + error(IO.mapInteger(Record.UnderlyingType, "UnderlyingType")); + error(IO.mapInteger(Record.FieldList, "FieldListType")); error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName, Record.hasUniqueName())); @@ -255,9 +261,9 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) { } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, BitFieldRecord &Record) { - error(IO.mapInteger(Record.Type)); - error(IO.mapInteger(Record.BitSize)); - error(IO.mapInteger(Record.BitOffset)); + error(IO.mapInteger(Record.Type, "Type")); + error(IO.mapInteger(Record.BitSize, "BitSize")); + error(IO.mapInteger(Record.BitOffset, "BitOffset")); return Error::success(); } @@ -268,7 +274,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, if (!IO.isReading()) { ArrayRef<VFTableSlotKind> Slots = Record.getSlots(); Size = Slots.size(); - error(IO.mapInteger(Size)); + error(IO.mapInteger(Size, "VFEntryCount")); for (size_t SlotIndex = 0; SlotIndex < Slots.size(); SlotIndex += 2) { uint8_t Byte = static_cast<uint8_t>(Slots[SlotIndex]) << 4; @@ -292,61 +298,64 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, VFTableRecord &Record) { - error(IO.mapInteger(Record.CompleteClass)); - error(IO.mapInteger(Record.OverriddenVFTable)); - error(IO.mapInteger(Record.VFPtrOffset)); + error(IO.mapInteger(Record.CompleteClass, "CompleteClass")); + error(IO.mapInteger(Record.OverriddenVFTable, "OverriddenVFTable")); + error(IO.mapInteger(Record.VFPtrOffset, "VFPtrOffset")); uint32_t NamesLen = 0; if (!IO.isReading()) { for (auto Name : Record.MethodNames) NamesLen += Name.size() + 1; } - error(IO.mapInteger(NamesLen)); + error(IO.mapInteger(NamesLen, "")); error(IO.mapVectorTail( Record.MethodNames, - [](CodeViewRecordIO &IO, StringRef &S) { return IO.mapStringZ(S); })); + [](CodeViewRecordIO &IO, StringRef &S) { + return IO.mapStringZ(S, "MethodName"); + }, + "VFTableName")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, StringIdRecord &Record) { - error(IO.mapInteger(Record.Id)); - error(IO.mapStringZ(Record.String)); + error(IO.mapInteger(Record.Id, "Id")); + error(IO.mapStringZ(Record.String, "StringData")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UdtSourceLineRecord &Record) { - error(IO.mapInteger(Record.UDT)); - error(IO.mapInteger(Record.SourceFile)); - error(IO.mapInteger(Record.LineNumber)); + error(IO.mapInteger(Record.UDT, "UDT")); + error(IO.mapInteger(Record.SourceFile, "SourceFile")); + error(IO.mapInteger(Record.LineNumber, "LineNumber")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UdtModSourceLineRecord &Record) { - error(IO.mapInteger(Record.UDT)); - error(IO.mapInteger(Record.SourceFile)); - error(IO.mapInteger(Record.LineNumber)); - error(IO.mapInteger(Record.Module)); + error(IO.mapInteger(Record.UDT, "UDT")); + error(IO.mapInteger(Record.SourceFile, "SourceFile")); + error(IO.mapInteger(Record.LineNumber, "LineNumber")); + error(IO.mapInteger(Record.Module, "Module")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, FuncIdRecord &Record) { - error(IO.mapInteger(Record.ParentScope)); - error(IO.mapInteger(Record.FunctionType)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.ParentScope, "ParentScope")); + error(IO.mapInteger(Record.FunctionType, "FunctionType")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, MemberFuncIdRecord &Record) { - error(IO.mapInteger(Record.ClassType)); - error(IO.mapInteger(Record.FunctionType)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.ClassType, "ClassType")); + error(IO.mapInteger(Record.FunctionType, "FunctionType")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } @@ -355,7 +364,10 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, BuildInfoRecord &Record) { error(IO.mapVectorN<uint16_t>( Record.ArgIndices, - [](CodeViewRecordIO &IO, TypeIndex &N) { return IO.mapInteger(N); })); + [](CodeViewRecordIO &IO, TypeIndex &N) { + return IO.mapInteger(N, "Argument"); + }, + "NumArgs")); return Error::success(); } @@ -364,7 +376,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, MethodOverloadListRecord &Record) { // TODO: Split the list into multiple records if it's longer than 64KB, using // a subrecord of TypeRecordKind::Index to chain the records together. - error(IO.mapVectorTail(Record.Methods, MapOneMethodRecord(true))); + error(IO.mapVectorTail(Record.Methods, MapOneMethodRecord(true), "Method")); return Error::success(); } @@ -378,22 +390,22 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, Error TypeRecordMapping::visitKnownRecord(CVType &CVR, TypeServer2Record &Record) { - error(IO.mapGuid(Record.Guid)); - error(IO.mapInteger(Record.Age)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapGuid(Record.Guid, "Guid")); + error(IO.mapInteger(Record.Age, "Age")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, LabelRecord &Record) { - error(IO.mapEnum(Record.Mode)); + error(IO.mapEnum(Record.Mode, "Mode")); return Error::success(); } Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, BaseClassRecord &Record) { - error(IO.mapInteger(Record.Attrs.Attrs)); - error(IO.mapInteger(Record.Type)); - error(IO.mapEncodedInteger(Record.Offset)); + error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier")); + error(IO.mapInteger(Record.Type, "BaseType")); + error(IO.mapEncodedInteger(Record.Offset, "BaseOffset")); return Error::success(); } @@ -403,27 +415,27 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, error(IO.mapInteger(Record.Attrs.Attrs)); // FIXME: Handle full APInt such as __int128. - error(IO.mapEncodedInteger(Record.Value)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapEncodedInteger(Record.Value, "EnumValue")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, DataMemberRecord &Record) { - error(IO.mapInteger(Record.Attrs.Attrs)); - error(IO.mapInteger(Record.Type)); - error(IO.mapEncodedInteger(Record.FieldOffset)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier")); + error(IO.mapInteger(Record.Type, "Type")); + error(IO.mapEncodedInteger(Record.FieldOffset, "FieldOffset")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, OverloadedMethodRecord &Record) { - error(IO.mapInteger(Record.NumOverloads)); - error(IO.mapInteger(Record.MethodList)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.NumOverloads, "MethodCount")); + error(IO.mapInteger(Record.MethodList, "MethodListIndex")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } @@ -438,9 +450,9 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, NestedTypeRecord &Record) { uint16_t Padding = 0; - error(IO.mapInteger(Padding)); - error(IO.mapInteger(Record.Type)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Padding, "Padding")); + error(IO.mapInteger(Record.Type, "Type")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } @@ -448,9 +460,9 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, StaticDataMemberRecord &Record) { - error(IO.mapInteger(Record.Attrs.Attrs)); - error(IO.mapInteger(Record.Type)); - error(IO.mapStringZ(Record.Name)); + error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier")); + error(IO.mapInteger(Record.Type, "Type")); + error(IO.mapStringZ(Record.Name, "Name")); return Error::success(); } @@ -458,11 +470,11 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, VirtualBaseClassRecord &Record) { - error(IO.mapInteger(Record.Attrs.Attrs)); - error(IO.mapInteger(Record.BaseType)); - error(IO.mapInteger(Record.VBPtrType)); - error(IO.mapEncodedInteger(Record.VBPtrOffset)); - error(IO.mapEncodedInteger(Record.VTableIndex)); + error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier")); + error(IO.mapInteger(Record.BaseType, "BaseType")); + error(IO.mapInteger(Record.VBPtrType, "VBPtrType")); + error(IO.mapEncodedInteger(Record.VBPtrOffset, "VBPtrOffset")); + error(IO.mapEncodedInteger(Record.VTableIndex, "VBTableIndex")); return Error::success(); } @@ -470,8 +482,8 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, VFPtrRecord &Record) { uint16_t Padding = 0; - error(IO.mapInteger(Padding)); - error(IO.mapInteger(Record.Type)); + error(IO.mapInteger(Padding, "Padding")); + error(IO.mapInteger(Record.Type, "Type")); return Error::success(); } @@ -479,23 +491,23 @@ Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR, ListContinuationRecord &Record) { uint16_t Padding = 0; - error(IO.mapInteger(Padding)); - error(IO.mapInteger(Record.ContinuationIndex)); + error(IO.mapInteger(Padding, "Padding")); + error(IO.mapInteger(Record.ContinuationIndex, "ContinuationIndex")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, PrecompRecord &Precomp) { - error(IO.mapInteger(Precomp.StartTypeIndex)); - error(IO.mapInteger(Precomp.TypesCount)); - error(IO.mapInteger(Precomp.Signature)); - error(IO.mapStringZ(Precomp.PrecompFilePath)); + error(IO.mapInteger(Precomp.StartTypeIndex, "StartIndex")); + error(IO.mapInteger(Precomp.TypesCount, "Count")); + error(IO.mapInteger(Precomp.Signature, "Signature")); + error(IO.mapStringZ(Precomp.PrecompFilePath, "PrecompFile")); return Error::success(); } Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EndPrecompRecord &EndPrecomp) { - error(IO.mapInteger(EndPrecomp.Signature)); + error(IO.mapInteger(EndPrecomp.Signature, "Signature")); return Error::success(); } |