Loading llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h +33 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public: virtual void EmitBytes(StringRef Data) = 0; virtual void EmitIntValue(uint64_t Value, unsigned Size) = 0; virtual void EmitBinaryData(StringRef Data) = 0; virtual void AddComment(const Twine &T) = 0; virtual ~CodeViewRecordStreamer() = default; }; Loading Loading @@ -59,7 +60,7 @@ public: Error beginRecord(Optional<uint32_t> MaxLength); Error endRecord(); Error mapInteger(TypeIndex &TypeInd); Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = ""); bool isStreaming() const { return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr); Loading Loading @@ -92,8 +93,9 @@ public: return Error::success(); } template <typename T> Error mapInteger(T &Value) { template <typename T> Error mapInteger(T &Value, const Twine &Comment = "") { if (isStreaming()) { emitComment(Comment); Streamer->EmitIntValue((int)Value, sizeof(T)); incrStreamedLen(sizeof(T)); return Error::success(); Loading @@ -105,7 +107,7 @@ public: return Reader->readInteger(Value); } template <typename T> Error mapEnum(T &Value) { template <typename T> Error mapEnum(T &Value, const Twine &Comment = "") { if (!isStreaming() && sizeof(Value) > maxFieldLength()) return make_error<CodeViewError>(cv_error_code::insufficient_buffer); Loading @@ -115,7 +117,7 @@ public: if (isWriting() || isStreaming()) X = static_cast<U>(Value); if (auto EC = mapInteger(X)) if (auto EC = mapInteger(X, Comment)) return EC; if (isReading()) Loading @@ -124,19 +126,22 @@ public: return Error::success(); } Error mapEncodedInteger(int64_t &Value); Error mapEncodedInteger(uint64_t &Value); Error mapEncodedInteger(APSInt &Value); Error mapStringZ(StringRef &Value); Error mapGuid(GUID &Guid); Error mapEncodedInteger(int64_t &Value, const Twine &Comment = ""); Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = ""); Error mapEncodedInteger(APSInt &Value, const Twine &Comment = ""); Error mapStringZ(StringRef &Value, const Twine &Comment = ""); Error mapGuid(GUID &Guid, const Twine &Comment = ""); Error mapStringZVectorZ(std::vector<StringRef> &Value); Error mapStringZVectorZ(std::vector<StringRef> &Value, const Twine &Comment = ""); template <typename SizeType, typename T, typename ElementMapper> Error mapVectorN(T &Items, const ElementMapper &Mapper) { Error mapVectorN(T &Items, const ElementMapper &Mapper, const Twine &Comment = "") { SizeType Size; if (isStreaming()) { Size = static_cast<SizeType>(Items.size()); emitComment(Comment); Streamer->EmitIntValue(Size, sizeof(Size)); incrStreamedLen(sizeof(Size)); // add 1 for the delimiter Loading Loading @@ -168,7 +173,9 @@ public: } template <typename T, typename ElementMapper> Error mapVectorTail(T &Items, const ElementMapper &Mapper) { Error mapVectorTail(T &Items, const ElementMapper &Mapper, const Twine &Comment = "") { emitComment(Comment); if (isStreaming() || isWriting()) { for (auto &Item : Items) { if (auto EC = Mapper(*this, Item)) Loading @@ -186,8 +193,9 @@ public: return Error::success(); } Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes); Error mapByteVectorTail(std::vector<uint8_t> &Bytes); Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = ""); Error mapByteVectorTail(std::vector<uint8_t> &Bytes, const Twine &Comment = ""); Error padToAlignment(uint32_t Align); Error skipPadding(); Loading @@ -199,8 +207,10 @@ public: } private: void emitEncodedSignedInteger(const int64_t &Value); void emitEncodedUnsignedInteger(const uint64_t &Value); void emitEncodedSignedInteger(const int64_t &Value, const Twine &Comment = ""); void emitEncodedUnsignedInteger(const uint64_t &Value, const Twine &Comment = ""); Error writeEncodedSignedInteger(const int64_t &Value); Error writeEncodedUnsignedInteger(const uint64_t &Value); Loading @@ -214,6 +224,13 @@ private: StreamedLen = 4; // The record prefix is 4 bytes long } void emitComment(const Twine &Comment) { if (isStreaming()) { Twine TComment(Comment); Streamer->AddComment(TComment); } } struct RecordLimit { uint32_t BeginOffset; Optional<uint32_t> MaxLength; Loading llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ public: void EmitBinaryData(StringRef Data) { OS->EmitBinaryData(Data); } void AddComment(const Twine &T) { OS->AddComment(T); } private: MCStreamer *OS = nullptr; }; Loading Loading @@ -615,6 +617,13 @@ emitNullTerminatedSymbolName(MCStreamer &OS, StringRef S, OS.EmitBytes(NullTerminatedString); } static StringRef getTypeLeafName(TypeLeafKind TypeKind) { for (const EnumEntry<TypeLeafKind> &EE : getTypeLeafNames()) if (EE.Value == TypeKind) return EE.Name; return ""; } void CodeViewDebug::emitTypeInformation() { if (TypeTable.empty()) return; Loading Loading @@ -659,8 +668,12 @@ void CodeViewDebug::emitTypeInformation() { auto RecordLen = Record.length(); auto RecordKind = Record.kind(); OS.EmitIntValue(RecordLen - 2, 2); OS.EmitIntValue(RecordKind, sizeof(RecordKind)); if (OS.isVerboseAsm()) CVMCOS.AddComment("Record length"); CVMCOS.EmitIntValue(RecordLen - 2, 2); if (OS.isVerboseAsm()) CVMCOS.AddComment("Record kind: " + getTypeLeafName(RecordKind)); CVMCOS.EmitIntValue(RecordKind, sizeof(RecordKind)); Error E = codeview::visitTypeRecord(Record, *B, Pipeline); Loading llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +37 −17 Original line number Diff line number Diff line Loading @@ -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()) { Loading @@ -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()); Loading @@ -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()) { Loading @@ -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))) Loading @@ -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; Loading @@ -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()); Loading @@ -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()) { Loading @@ -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(); Loading @@ -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; Loading @@ -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); } Loading llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +120 −108 File changed.Preview size limit exceeded, changes collapsed. Show changes llvm/test/DebugInfo/COFF/types-basic.ll +120 −122 Original line number Diff line number Diff line Loading @@ -347,17 +347,15 @@ ; CHECK: ] ; CHECK: ] ; ASM: .section .debug$T,"dr" ; ASM: .p2align 2 ; ASM: .long 4 # Debug section magic ; ASM: .short 18 ; ASM: .short 4609 ; ASM: .long 3 ; ASM: .long 64 ; ASM: .long 65 ; ASM: .long 19 ; ASM: .short 18 # Record length ; ASM: .short 4609 # Record kind: LF_ARGLIST ; ASM: .long 3 # NumArgs ; ASM: .long 64 # Argument ; ASM: .long 65 # Argument ; ASM: .long 19 # Argument ; ASM: # ArgList (0x1000) { ; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) ; ASM: # NumArgs: 3 Loading @@ -367,13 +365,13 @@ ; ASM: # ArgType: __int64 (0x13) ; ASM: # ] ; ASM: # } ; ASM: .short 14 ; ASM: .short 4104 ; ASM: .long 3 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 3 ; ASM: .long 4096 ; ASM: .short 14 # Record length ; ASM: .short 4104 # Record kind: LF_PROCEDURE ; ASM: .long 3 # ReturnType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 3 # NumParameters ; ASM: .long 4096 # ArgListType ; ASM: # Procedure (0x1001) { ; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) ; ASM: # ReturnType: void (0x3) Loading @@ -383,11 +381,11 @@ ; ASM: # NumParameters: 3 ; ASM: # ArgListType: (float, double, __int64) (0x1000) ; ASM: # } ; ASM: .short 14 ; ASM: .short 5633 ; ASM: .long 0 ; ASM: .long 4097 ; ASM: .asciz "f" ; ASM: .short 14 # Record length ; ASM: .short 5633 # Record kind: LF_FUNC_ID ; ASM: .long 0 # ParentScope ; ASM: .long 4097 # FunctionType ; ASM: .asciz "f" # Name ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # FuncId (0x1002) { Loading @@ -396,10 +394,10 @@ ; ASM: # FunctionType: void (float, double, __int64) (0x1001) ; ASM: # Name: f ; ASM: # } ; ASM: .short 10 ; ASM: .short 4097 ; ASM: .long 116 ; ASM: .short 1 ; ASM: .short 10 # Record length ; ASM: .short 4097 # Record kind: LF_MODIFIER ; ASM: .long 116 # ModifiedType ; ASM: .short 1 # Modifiers ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Modifier (0x1003) { Loading @@ -409,10 +407,10 @@ ; ASM: # Const (0x1) ; ASM: # ] ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4099 ; ASM: .long 65548 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4099 # PointeeType ; ASM: .long 65548 # Attributes ; ASM: # Pointer (0x1004) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: const int (0x1003) Loading @@ -427,15 +425,15 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 22 ; ASM: .short 5381 ; ASM: .short 0 ; ASM: .short 128 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 0 ; ASM: .asciz "A" ; ASM: .short 22 # Record length ; ASM: .short 5381 # Record kind: LF_STRUCTURE ; ASM: .short 0 # MemberCount ; ASM: .short 128 # Properties ; ASM: .long 0 # FieldList ; ASM: .long 0 # DerivedFrom ; ASM: .long 0 # VShape ; ASM: .short 0 # SizeOf ; ASM: .asciz "A" # Name ; ASM: # Struct (0x1005) { ; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) ; ASM: # MemberCount: 0 Loading @@ -448,12 +446,12 @@ ; ASM: # SizeOf: 0 ; ASM: # Name: A ; ASM: # } ; ASM: .short 18 ; ASM: .short 4098 ; ASM: .long 116 ; ASM: .long 32844 ; ASM: .long 4101 ; ASM: .short 4 ; ASM: .short 18 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 116 # PointeeType ; ASM: .long 32844 # Attributes ; ASM: .long 4101 # ClassType ; ASM: .short 4 # Representation ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Pointer (0x1006) { Loading @@ -472,10 +470,10 @@ ; ASM: # ClassType: A (0x1005) ; ASM: # Representation: GeneralData (0x4) ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4101 ; ASM: .long 66572 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4101 # PointeeType ; ASM: .long 66572 # Attributes ; ASM: # Pointer (0x1007) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: A (0x1005) Loading @@ -490,25 +488,25 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 6 ; ASM: .short 4609 ; ASM: .long 0 ; ASM: .short 6 # Record length ; ASM: .short 4609 # Record kind: LF_ARGLIST ; ASM: .long 0 # NumArgs ; ASM: # ArgList (0x1008) { ; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) ; ASM: # NumArgs: 0 ; ASM: # Arguments [ ; ASM: # ] ; ASM: # } ; ASM: .short 26 ; ASM: .short 4105 ; ASM: .long 3 ; ASM: .long 4101 ; ASM: .long 4103 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 0 ; ASM: .long 4104 ; ASM: .long 0 ; ASM: .short 26 # Record length ; ASM: .short 4105 # Record kind: LF_MFUNCTION ; ASM: .long 3 # ReturnType ; ASM: .long 4101 # ClassType ; ASM: .long 4103 # ThisType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 0 # NumParameters ; ASM: .long 4104 # ArgListType ; ASM: .long 0 # ThisAdjustment ; ASM: # MemberFunction (0x1009) { ; ASM: # TypeLeafKind: LF_MFUNCTION (0x1009) ; ASM: # ReturnType: void (0x3) Loading @@ -521,8 +519,8 @@ ; ASM: # ArgListType: () (0x1008) ; ASM: # ThisAdjustment: 0 ; ASM: # } ; ASM: .short 30 ; ASM: .short 4611 ; ASM: .short 30 # Record length ; ASM: .short 4611 # Record kind: LF_FIELDLIST ; ASM: .byte 0x0d, 0x15, 0x03, 0x00 ; ASM: .byte 0x74, 0x00, 0x00, 0x00 ; ASM: .byte 0x00, 0x00, 0x61, 0x00 Loading @@ -546,15 +544,15 @@ ; ASM: # Name: A::f ; ASM: # } ; ASM: # } ; ASM: .short 22 ; ASM: .short 5381 ; ASM: .short 2 ; ASM: .short 0 ; ASM: .long 4106 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 4 ; ASM: .asciz "A" ; ASM: .short 22 # Record length ; ASM: .short 5381 # Record kind: LF_STRUCTURE ; ASM: .short 2 # MemberCount ; ASM: .short 0 # Properties ; ASM: .long 4106 # FieldList ; ASM: .long 0 # DerivedFrom ; ASM: .long 0 # VShape ; ASM: .short 4 # SizeOf ; ASM: .asciz "A" # Name ; ASM: # Struct (0x100B) { ; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) ; ASM: # MemberCount: 2 Loading @@ -566,32 +564,32 @@ ; ASM: # SizeOf: 4 ; ASM: # Name: A ; ASM: # } ; ASM: .short 30 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" ; ASM: .short 30 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" # StringData ; ASM: # StringId (0x100C) { ; ASM: # TypeLeafKind: LF_STRING_ID (0x1605) ; ASM: # Id: 0x0 ; ASM: # StringData: D:\src\llvm\build\t.cpp ; ASM: # } ; ASM: .short 14 ; ASM: .short 5638 ; ASM: .long 4107 ; ASM: .long 4108 ; ASM: .long 1 ; ASM: .short 14 # Record length ; ASM: .short 5638 # Record kind: LF_UDT_SRC_LINE ; ASM: .long 4107 # UDT ; ASM: .long 4108 # SourceFile ; ASM: .long 1 # LineNumber ; ASM: # UdtSourceLine (0x100D) { ; ASM: # TypeLeafKind: LF_UDT_SRC_LINE (0x1606) ; ASM: # UDT: A (0x100B) ; ASM: # SourceFile: D:\src\llvm\build\t.cpp (0x100C) ; ASM: # LineNumber: 1 ; ASM: # } ; ASM: .short 18 ; ASM: .short 4098 ; ASM: .long 4105 ; ASM: .long 65644 ; ASM: .long 4101 ; ASM: .short 8 ; ASM: .short 18 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4105 # PointeeType ; ASM: .long 65644 # Attributes ; ASM: .long 4101 # ClassType ; ASM: .short 8 # Representation ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Pointer (0x100E) { Loading @@ -610,10 +608,10 @@ ; ASM: # ClassType: A (0x1005) ; ASM: # Representation: GeneralFunction (0x8) ; ASM: # } ; ASM: .short 10 ; ASM: .short 4097 ; ASM: .long 3 ; ASM: .short 1 ; ASM: .short 10 # Record length ; ASM: .short 4097 # Record kind: LF_MODIFIER ; ASM: .long 3 # ModifiedType ; ASM: .short 1 # Modifiers ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Modifier (0x100F) { Loading @@ -623,10 +621,10 @@ ; ASM: # Const (0x1) ; ASM: # ] ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4111 ; ASM: .long 65548 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4111 # PointeeType ; ASM: .long 65548 # Attributes ; ASM: # Pointer (0x1010) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: const void (0x100F) Loading @@ -641,13 +639,13 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 14 ; ASM: .short 4104 ; ASM: .long 3 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 0 ; ASM: .long 4104 ; ASM: .short 14 # Record length ; ASM: .short 4104 # Record kind: LF_PROCEDURE ; ASM: .long 3 # ReturnType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 0 # NumParameters ; ASM: .long 4104 # ArgListType ; ASM: # Procedure (0x1011) { ; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) ; ASM: # ReturnType: void (0x3) Loading @@ -657,11 +655,11 @@ ; ASM: # NumParameters: 0 ; ASM: # ArgListType: () (0x1008) ; ASM: # } ; ASM: .short 22 ; ASM: .short 5633 ; ASM: .long 0 ; ASM: .long 4113 ; ASM: .asciz "CharTypes" ; ASM: .short 22 # Record length ; ASM: .short 5633 # Record kind: LF_FUNC_ID ; ASM: .long 0 # ParentScope ; ASM: .long 4113 # FunctionType ; ASM: .asciz "CharTypes" # Name ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # FuncId (0x1012) { Loading @@ -670,10 +668,10 @@ ; ASM: # FunctionType: void () (0x1011) ; ASM: # Name: CharTypes ; ASM: # } ; ASM: .short 26 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "D:\\src\\llvm\\build" ; ASM: .short 26 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "D:\\src\\llvm\\build" # StringData ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # StringId (0x1013) { Loading @@ -681,10 +679,10 @@ ; ASM: # Id: 0x0 ; ASM: # StringData: D:\src\llvm\build ; ASM: # } ; ASM: .short 14 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "t.cpp" ; ASM: .short 14 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "t.cpp" # StringData ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # StringId (0x1014) { Loading @@ -692,14 +690,14 @@ ; ASM: # Id: 0x0 ; ASM: # StringData: t.cpp ; ASM: # } ; ASM: .short 26 ; ASM: .short 5635 ; ASM: .short 5 ; ASM: .long 4115 ; ASM: .long 0 ; ASM: .long 4116 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 26 # Record length ; ASM: .short 5635 # Record kind: LF_BUILDINFO ; ASM: .short 5 # NumArgs ; ASM: .long 4115 # Argument ; ASM: .long 0 # Argument ; ASM: .long 4116 # Argument ; ASM: .long 0 # Argument ; ASM: .long 0 # Argument ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # BuildInfo (0x1015) { Loading Loading
llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h +33 −16 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public: virtual void EmitBytes(StringRef Data) = 0; virtual void EmitIntValue(uint64_t Value, unsigned Size) = 0; virtual void EmitBinaryData(StringRef Data) = 0; virtual void AddComment(const Twine &T) = 0; virtual ~CodeViewRecordStreamer() = default; }; Loading Loading @@ -59,7 +60,7 @@ public: Error beginRecord(Optional<uint32_t> MaxLength); Error endRecord(); Error mapInteger(TypeIndex &TypeInd); Error mapInteger(TypeIndex &TypeInd, const Twine &Comment = ""); bool isStreaming() const { return (Streamer != nullptr) && (Reader == nullptr) && (Writer == nullptr); Loading Loading @@ -92,8 +93,9 @@ public: return Error::success(); } template <typename T> Error mapInteger(T &Value) { template <typename T> Error mapInteger(T &Value, const Twine &Comment = "") { if (isStreaming()) { emitComment(Comment); Streamer->EmitIntValue((int)Value, sizeof(T)); incrStreamedLen(sizeof(T)); return Error::success(); Loading @@ -105,7 +107,7 @@ public: return Reader->readInteger(Value); } template <typename T> Error mapEnum(T &Value) { template <typename T> Error mapEnum(T &Value, const Twine &Comment = "") { if (!isStreaming() && sizeof(Value) > maxFieldLength()) return make_error<CodeViewError>(cv_error_code::insufficient_buffer); Loading @@ -115,7 +117,7 @@ public: if (isWriting() || isStreaming()) X = static_cast<U>(Value); if (auto EC = mapInteger(X)) if (auto EC = mapInteger(X, Comment)) return EC; if (isReading()) Loading @@ -124,19 +126,22 @@ public: return Error::success(); } Error mapEncodedInteger(int64_t &Value); Error mapEncodedInteger(uint64_t &Value); Error mapEncodedInteger(APSInt &Value); Error mapStringZ(StringRef &Value); Error mapGuid(GUID &Guid); Error mapEncodedInteger(int64_t &Value, const Twine &Comment = ""); Error mapEncodedInteger(uint64_t &Value, const Twine &Comment = ""); Error mapEncodedInteger(APSInt &Value, const Twine &Comment = ""); Error mapStringZ(StringRef &Value, const Twine &Comment = ""); Error mapGuid(GUID &Guid, const Twine &Comment = ""); Error mapStringZVectorZ(std::vector<StringRef> &Value); Error mapStringZVectorZ(std::vector<StringRef> &Value, const Twine &Comment = ""); template <typename SizeType, typename T, typename ElementMapper> Error mapVectorN(T &Items, const ElementMapper &Mapper) { Error mapVectorN(T &Items, const ElementMapper &Mapper, const Twine &Comment = "") { SizeType Size; if (isStreaming()) { Size = static_cast<SizeType>(Items.size()); emitComment(Comment); Streamer->EmitIntValue(Size, sizeof(Size)); incrStreamedLen(sizeof(Size)); // add 1 for the delimiter Loading Loading @@ -168,7 +173,9 @@ public: } template <typename T, typename ElementMapper> Error mapVectorTail(T &Items, const ElementMapper &Mapper) { Error mapVectorTail(T &Items, const ElementMapper &Mapper, const Twine &Comment = "") { emitComment(Comment); if (isStreaming() || isWriting()) { for (auto &Item : Items) { if (auto EC = Mapper(*this, Item)) Loading @@ -186,8 +193,9 @@ public: return Error::success(); } Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes); Error mapByteVectorTail(std::vector<uint8_t> &Bytes); Error mapByteVectorTail(ArrayRef<uint8_t> &Bytes, const Twine &Comment = ""); Error mapByteVectorTail(std::vector<uint8_t> &Bytes, const Twine &Comment = ""); Error padToAlignment(uint32_t Align); Error skipPadding(); Loading @@ -199,8 +207,10 @@ public: } private: void emitEncodedSignedInteger(const int64_t &Value); void emitEncodedUnsignedInteger(const uint64_t &Value); void emitEncodedSignedInteger(const int64_t &Value, const Twine &Comment = ""); void emitEncodedUnsignedInteger(const uint64_t &Value, const Twine &Comment = ""); Error writeEncodedSignedInteger(const int64_t &Value); Error writeEncodedUnsignedInteger(const uint64_t &Value); Loading @@ -214,6 +224,13 @@ private: StreamedLen = 4; // The record prefix is 4 bytes long } void emitComment(const Twine &Comment) { if (isStreaming()) { Twine TComment(Comment); Streamer->AddComment(TComment); } } struct RecordLimit { uint32_t BeginOffset; Optional<uint32_t> MaxLength; Loading
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,8 @@ public: void EmitBinaryData(StringRef Data) { OS->EmitBinaryData(Data); } void AddComment(const Twine &T) { OS->AddComment(T); } private: MCStreamer *OS = nullptr; }; Loading Loading @@ -615,6 +617,13 @@ emitNullTerminatedSymbolName(MCStreamer &OS, StringRef S, OS.EmitBytes(NullTerminatedString); } static StringRef getTypeLeafName(TypeLeafKind TypeKind) { for (const EnumEntry<TypeLeafKind> &EE : getTypeLeafNames()) if (EE.Value == TypeKind) return EE.Name; return ""; } void CodeViewDebug::emitTypeInformation() { if (TypeTable.empty()) return; Loading Loading @@ -659,8 +668,12 @@ void CodeViewDebug::emitTypeInformation() { auto RecordLen = Record.length(); auto RecordKind = Record.kind(); OS.EmitIntValue(RecordLen - 2, 2); OS.EmitIntValue(RecordKind, sizeof(RecordKind)); if (OS.isVerboseAsm()) CVMCOS.AddComment("Record length"); CVMCOS.EmitIntValue(RecordLen - 2, 2); if (OS.isVerboseAsm()) CVMCOS.AddComment("Record kind: " + getTypeLeafName(RecordKind)); CVMCOS.EmitIntValue(RecordKind, sizeof(RecordKind)); Error E = codeview::visitTypeRecord(Record, *B, Pipeline); Loading
llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp +37 −17 Original line number Diff line number Diff line Loading @@ -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()) { Loading @@ -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()); Loading @@ -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()) { Loading @@ -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))) Loading @@ -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; Loading @@ -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()); Loading @@ -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()) { Loading @@ -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(); Loading @@ -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; Loading @@ -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); } Loading
llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +120 −108 File changed.Preview size limit exceeded, changes collapsed. Show changes
llvm/test/DebugInfo/COFF/types-basic.ll +120 −122 Original line number Diff line number Diff line Loading @@ -347,17 +347,15 @@ ; CHECK: ] ; CHECK: ] ; ASM: .section .debug$T,"dr" ; ASM: .p2align 2 ; ASM: .long 4 # Debug section magic ; ASM: .short 18 ; ASM: .short 4609 ; ASM: .long 3 ; ASM: .long 64 ; ASM: .long 65 ; ASM: .long 19 ; ASM: .short 18 # Record length ; ASM: .short 4609 # Record kind: LF_ARGLIST ; ASM: .long 3 # NumArgs ; ASM: .long 64 # Argument ; ASM: .long 65 # Argument ; ASM: .long 19 # Argument ; ASM: # ArgList (0x1000) { ; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) ; ASM: # NumArgs: 3 Loading @@ -367,13 +365,13 @@ ; ASM: # ArgType: __int64 (0x13) ; ASM: # ] ; ASM: # } ; ASM: .short 14 ; ASM: .short 4104 ; ASM: .long 3 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 3 ; ASM: .long 4096 ; ASM: .short 14 # Record length ; ASM: .short 4104 # Record kind: LF_PROCEDURE ; ASM: .long 3 # ReturnType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 3 # NumParameters ; ASM: .long 4096 # ArgListType ; ASM: # Procedure (0x1001) { ; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) ; ASM: # ReturnType: void (0x3) Loading @@ -383,11 +381,11 @@ ; ASM: # NumParameters: 3 ; ASM: # ArgListType: (float, double, __int64) (0x1000) ; ASM: # } ; ASM: .short 14 ; ASM: .short 5633 ; ASM: .long 0 ; ASM: .long 4097 ; ASM: .asciz "f" ; ASM: .short 14 # Record length ; ASM: .short 5633 # Record kind: LF_FUNC_ID ; ASM: .long 0 # ParentScope ; ASM: .long 4097 # FunctionType ; ASM: .asciz "f" # Name ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # FuncId (0x1002) { Loading @@ -396,10 +394,10 @@ ; ASM: # FunctionType: void (float, double, __int64) (0x1001) ; ASM: # Name: f ; ASM: # } ; ASM: .short 10 ; ASM: .short 4097 ; ASM: .long 116 ; ASM: .short 1 ; ASM: .short 10 # Record length ; ASM: .short 4097 # Record kind: LF_MODIFIER ; ASM: .long 116 # ModifiedType ; ASM: .short 1 # Modifiers ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Modifier (0x1003) { Loading @@ -409,10 +407,10 @@ ; ASM: # Const (0x1) ; ASM: # ] ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4099 ; ASM: .long 65548 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4099 # PointeeType ; ASM: .long 65548 # Attributes ; ASM: # Pointer (0x1004) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: const int (0x1003) Loading @@ -427,15 +425,15 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 22 ; ASM: .short 5381 ; ASM: .short 0 ; ASM: .short 128 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 0 ; ASM: .asciz "A" ; ASM: .short 22 # Record length ; ASM: .short 5381 # Record kind: LF_STRUCTURE ; ASM: .short 0 # MemberCount ; ASM: .short 128 # Properties ; ASM: .long 0 # FieldList ; ASM: .long 0 # DerivedFrom ; ASM: .long 0 # VShape ; ASM: .short 0 # SizeOf ; ASM: .asciz "A" # Name ; ASM: # Struct (0x1005) { ; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) ; ASM: # MemberCount: 0 Loading @@ -448,12 +446,12 @@ ; ASM: # SizeOf: 0 ; ASM: # Name: A ; ASM: # } ; ASM: .short 18 ; ASM: .short 4098 ; ASM: .long 116 ; ASM: .long 32844 ; ASM: .long 4101 ; ASM: .short 4 ; ASM: .short 18 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 116 # PointeeType ; ASM: .long 32844 # Attributes ; ASM: .long 4101 # ClassType ; ASM: .short 4 # Representation ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Pointer (0x1006) { Loading @@ -472,10 +470,10 @@ ; ASM: # ClassType: A (0x1005) ; ASM: # Representation: GeneralData (0x4) ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4101 ; ASM: .long 66572 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4101 # PointeeType ; ASM: .long 66572 # Attributes ; ASM: # Pointer (0x1007) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: A (0x1005) Loading @@ -490,25 +488,25 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 6 ; ASM: .short 4609 ; ASM: .long 0 ; ASM: .short 6 # Record length ; ASM: .short 4609 # Record kind: LF_ARGLIST ; ASM: .long 0 # NumArgs ; ASM: # ArgList (0x1008) { ; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) ; ASM: # NumArgs: 0 ; ASM: # Arguments [ ; ASM: # ] ; ASM: # } ; ASM: .short 26 ; ASM: .short 4105 ; ASM: .long 3 ; ASM: .long 4101 ; ASM: .long 4103 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 0 ; ASM: .long 4104 ; ASM: .long 0 ; ASM: .short 26 # Record length ; ASM: .short 4105 # Record kind: LF_MFUNCTION ; ASM: .long 3 # ReturnType ; ASM: .long 4101 # ClassType ; ASM: .long 4103 # ThisType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 0 # NumParameters ; ASM: .long 4104 # ArgListType ; ASM: .long 0 # ThisAdjustment ; ASM: # MemberFunction (0x1009) { ; ASM: # TypeLeafKind: LF_MFUNCTION (0x1009) ; ASM: # ReturnType: void (0x3) Loading @@ -521,8 +519,8 @@ ; ASM: # ArgListType: () (0x1008) ; ASM: # ThisAdjustment: 0 ; ASM: # } ; ASM: .short 30 ; ASM: .short 4611 ; ASM: .short 30 # Record length ; ASM: .short 4611 # Record kind: LF_FIELDLIST ; ASM: .byte 0x0d, 0x15, 0x03, 0x00 ; ASM: .byte 0x74, 0x00, 0x00, 0x00 ; ASM: .byte 0x00, 0x00, 0x61, 0x00 Loading @@ -546,15 +544,15 @@ ; ASM: # Name: A::f ; ASM: # } ; ASM: # } ; ASM: .short 22 ; ASM: .short 5381 ; ASM: .short 2 ; ASM: .short 0 ; ASM: .long 4106 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 4 ; ASM: .asciz "A" ; ASM: .short 22 # Record length ; ASM: .short 5381 # Record kind: LF_STRUCTURE ; ASM: .short 2 # MemberCount ; ASM: .short 0 # Properties ; ASM: .long 4106 # FieldList ; ASM: .long 0 # DerivedFrom ; ASM: .long 0 # VShape ; ASM: .short 4 # SizeOf ; ASM: .asciz "A" # Name ; ASM: # Struct (0x100B) { ; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) ; ASM: # MemberCount: 2 Loading @@ -566,32 +564,32 @@ ; ASM: # SizeOf: 4 ; ASM: # Name: A ; ASM: # } ; ASM: .short 30 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" ; ASM: .short 30 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" # StringData ; ASM: # StringId (0x100C) { ; ASM: # TypeLeafKind: LF_STRING_ID (0x1605) ; ASM: # Id: 0x0 ; ASM: # StringData: D:\src\llvm\build\t.cpp ; ASM: # } ; ASM: .short 14 ; ASM: .short 5638 ; ASM: .long 4107 ; ASM: .long 4108 ; ASM: .long 1 ; ASM: .short 14 # Record length ; ASM: .short 5638 # Record kind: LF_UDT_SRC_LINE ; ASM: .long 4107 # UDT ; ASM: .long 4108 # SourceFile ; ASM: .long 1 # LineNumber ; ASM: # UdtSourceLine (0x100D) { ; ASM: # TypeLeafKind: LF_UDT_SRC_LINE (0x1606) ; ASM: # UDT: A (0x100B) ; ASM: # SourceFile: D:\src\llvm\build\t.cpp (0x100C) ; ASM: # LineNumber: 1 ; ASM: # } ; ASM: .short 18 ; ASM: .short 4098 ; ASM: .long 4105 ; ASM: .long 65644 ; ASM: .long 4101 ; ASM: .short 8 ; ASM: .short 18 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4105 # PointeeType ; ASM: .long 65644 # Attributes ; ASM: .long 4101 # ClassType ; ASM: .short 8 # Representation ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Pointer (0x100E) { Loading @@ -610,10 +608,10 @@ ; ASM: # ClassType: A (0x1005) ; ASM: # Representation: GeneralFunction (0x8) ; ASM: # } ; ASM: .short 10 ; ASM: .short 4097 ; ASM: .long 3 ; ASM: .short 1 ; ASM: .short 10 # Record length ; ASM: .short 4097 # Record kind: LF_MODIFIER ; ASM: .long 3 # ModifiedType ; ASM: .short 1 # Modifiers ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # Modifier (0x100F) { Loading @@ -623,10 +621,10 @@ ; ASM: # Const (0x1) ; ASM: # ] ; ASM: # } ; ASM: .short 10 ; ASM: .short 4098 ; ASM: .long 4111 ; ASM: .long 65548 ; ASM: .short 10 # Record length ; ASM: .short 4098 # Record kind: LF_POINTER ; ASM: .long 4111 # PointeeType ; ASM: .long 65548 # Attributes ; ASM: # Pointer (0x1010) { ; ASM: # TypeLeafKind: LF_POINTER (0x1002) ; ASM: # PointeeType: const void (0x100F) Loading @@ -641,13 +639,13 @@ ; ASM: # IsThisPtr&&: 0 ; ASM: # SizeOf: 8 ; ASM: # } ; ASM: .short 14 ; ASM: .short 4104 ; ASM: .long 3 ; ASM: .byte 0 ; ASM: .byte 0 ; ASM: .short 0 ; ASM: .long 4104 ; ASM: .short 14 # Record length ; ASM: .short 4104 # Record kind: LF_PROCEDURE ; ASM: .long 3 # ReturnType ; ASM: .byte 0 # CallingConvention ; ASM: .byte 0 # FunctionOptions ; ASM: .short 0 # NumParameters ; ASM: .long 4104 # ArgListType ; ASM: # Procedure (0x1011) { ; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) ; ASM: # ReturnType: void (0x3) Loading @@ -657,11 +655,11 @@ ; ASM: # NumParameters: 0 ; ASM: # ArgListType: () (0x1008) ; ASM: # } ; ASM: .short 22 ; ASM: .short 5633 ; ASM: .long 0 ; ASM: .long 4113 ; ASM: .asciz "CharTypes" ; ASM: .short 22 # Record length ; ASM: .short 5633 # Record kind: LF_FUNC_ID ; ASM: .long 0 # ParentScope ; ASM: .long 4113 # FunctionType ; ASM: .asciz "CharTypes" # Name ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # FuncId (0x1012) { Loading @@ -670,10 +668,10 @@ ; ASM: # FunctionType: void () (0x1011) ; ASM: # Name: CharTypes ; ASM: # } ; ASM: .short 26 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "D:\\src\\llvm\\build" ; ASM: .short 26 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "D:\\src\\llvm\\build" # StringData ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # StringId (0x1013) { Loading @@ -681,10 +679,10 @@ ; ASM: # Id: 0x0 ; ASM: # StringData: D:\src\llvm\build ; ASM: # } ; ASM: .short 14 ; ASM: .short 5637 ; ASM: .long 0 ; ASM: .asciz "t.cpp" ; ASM: .short 14 # Record length ; ASM: .short 5637 # Record kind: LF_STRING_ID ; ASM: .long 0 # Id ; ASM: .asciz "t.cpp" # StringData ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # StringId (0x1014) { Loading @@ -692,14 +690,14 @@ ; ASM: # Id: 0x0 ; ASM: # StringData: t.cpp ; ASM: # } ; ASM: .short 26 ; ASM: .short 5635 ; ASM: .short 5 ; ASM: .long 4115 ; ASM: .long 0 ; ASM: .long 4116 ; ASM: .long 0 ; ASM: .long 0 ; ASM: .short 26 # Record length ; ASM: .short 5635 # Record kind: LF_BUILDINFO ; ASM: .short 5 # NumArgs ; ASM: .long 4115 # Argument ; ASM: .long 0 # Argument ; ASM: .long 4116 # Argument ; ASM: .long 0 # Argument ; ASM: .long 0 # Argument ; ASM: .byte 242 ; ASM: .byte 241 ; ASM: # BuildInfo (0x1015) { Loading