[llvm] r366720 - Changes to emit CodeView debug info nested type records properly using MCStreamer directives

Nilanjana Basu via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 11:22:55 PDT 2019


Author: nilanjana_basu
Date: Mon Jul 22 11:22:55 2019
New Revision: 366720

URL: http://llvm.org/viewvc/llvm-project?rev=366720&view=rev
Log:
Changes to emit CodeView debug info nested type records properly using MCStreamer directives

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
    llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
    llvm/trunk/include/llvm/MC/MCExpr.h
    llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
    llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
    llvm/trunk/test/DebugInfo/COFF/types-basic.ll
    llvm/trunk/test/DebugInfo/COFF/types-data-members.ll

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=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Mon Jul 22 11:22:55 2019
@@ -227,7 +227,8 @@ private:
   void emitComment(const Twine &Comment) {
     if (isStreaming()) {
       Twine TComment(Comment);
-      Streamer->AddComment(TComment);
+      if (!TComment.isTriviallyEmpty())
+        Streamer->AddComment(TComment);
     }
   }
 

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h Mon Jul 22 11:22:55 2019
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_TYPERECORDMAPPING_H
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
 #include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
 #include "llvm/Support/Error.h"

Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Mon Jul 22 11:22:55 2019
@@ -136,7 +136,7 @@ class MCConstantExpr : public MCExpr {
   int64_t Value;
   bool PrintInHex = false;
 
-  MCConstantExpr(int64_t Value)
+  explicit MCConstantExpr(int64_t Value)
       : MCExpr(MCExpr::Constant, SMLoc()), Value(Value) {}
 
   MCConstantExpr(int64_t Value, bool PrintInHex)

Modified: llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp Mon Jul 22 11:22:55 2019
@@ -20,7 +20,6 @@ Error CodeViewRecordIO::beginRecord(Opti
   Limit.MaxLength = MaxLength;
   Limit.BeginOffset = getCurrentOffset();
   Limits.push_back(Limit);
-  resetStreamedLen();
   return Error::success();
 }
 
@@ -50,6 +49,7 @@ Error CodeViewRecordIO::endRecord() {
       Streamer->EmitBytes(BytesSR);
       --PaddingBytes;
     }
+    resetStreamedLen();
   }
   return Error::success();
 }

Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp Mon Jul 22 11:22:55 2019
@@ -83,6 +83,18 @@ static Error mapNameAndUniqueName(CodeVi
   return Error::success();
 }
 
+static StringRef getLeafTypeName(TypeLeafKind LT) {
+  switch (LT) {
+#define TYPE_RECORD(ename, value, name)                                        \
+  case ename:                                                                  \
+    return #ename;
+#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
+  default:
+    break;
+  }
+  return "UnknownLeaf";
+}
+
 Error TypeRecordMapping::visitTypeBegin(CVType &CVR) {
   assert(!TypeKind.hasValue() && "Already in a type mapping!");
   assert(!MemberKind.hasValue() && "Already in a member mapping!");
@@ -121,11 +133,16 @@ Error TypeRecordMapping::visitMemberBegi
   // followed by the subrecord, followed by a continuation, and that entire
   // sequence spaws `MaxRecordLength` bytes.  So the record's length is
   // calculated as follows.
+
   constexpr uint32_t ContinuationLength = 8;
   error(IO.beginRecord(MaxRecordLength - sizeof(RecordPrefix) -
                        ContinuationLength));
 
   MemberKind = Record.Kind;
+  if (IO.isStreaming()) {
+    error(IO.mapEnum(Record.Kind,
+                     "Member kind: " + getLeafTypeName(Record.Kind)));
+  }
   return Error::success();
 }
 
@@ -383,7 +400,11 @@ Error TypeRecordMapping::visitKnownRecor
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
                                           FieldListRecord &Record) {
-  error(IO.mapByteVectorTail(Record.Data));
+  if (IO.isStreaming()) {
+    if (auto EC = codeview::visitMemberRecordStream(Record.Data, *this))
+      return EC;
+  } else
+    error(IO.mapByteVectorTail(Record.Data));
 
   return Error::success();
 }

Modified: llvm/trunk/test/DebugInfo/COFF/types-basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-basic.ll?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/types-basic.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/types-basic.ll Mon Jul 22 11:22:55 2019
@@ -521,13 +521,18 @@
 ; ASM: # }
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .byte	0x0d, 0x15, 0x03, 0x00
-; ASM: .byte	0x74, 0x00, 0x00, 0x00
-; ASM: .byte	0x00, 0x00, 0x61, 0x00
-; ASM: .byte	0x11, 0x15, 0x03, 0x00
-; ASM: .byte	0x09, 0x10, 0x00, 0x00
-; ASM: .byte	0x41, 0x3a, 0x3a, 0x66
-; ASM: .byte	0x00, 0xf3, 0xf2, 0xf1
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"a"                     # Name
+; ASM: .short	0x1511                  # Member kind: LF_ONEMETHOD
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x1009                  # Type
+; ASM: .asciz	"A::f"                  # Name
+; ASM: .byte	243
+; ASM: .byte	242
+; ASM: .byte	241
 ; ASM: # FieldList (0x100A) {
 ; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
 ; ASM: #   DataMember {

Modified: llvm/trunk/test/DebugInfo/COFF/types-data-members.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-data-members.ll?rev=366720&r1=366719&r2=366720&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/types-data-members.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/types-data-members.ll Mon Jul 22 11:22:55 2019
@@ -1,5 +1,6 @@
 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
 ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
+; RUN: llc < %s | FileCheck %s --check-prefix=ASM
 
 ; C++ source to regenerate:
 ; $ cat t.cpp
@@ -389,6 +390,725 @@
 ; CHECK:   }
 ; CHECK: ]
 
+; ASM: .section	.debug$T,"dr"
+; ASM: .p2align	2
+; ASM: .long	4                       # Debug section magic
+; ASM: .short	0x6                     # Record length
+; ASM: .short	0x1201                  # Record kind: LF_ARGLIST
+; ASM: .long	0x0                     # NumArgs
+; ASM: # ArgList (0x1000) {
+; ASM: #   TypeLeafKind: LF_ARGLIST (0x1201)
+; ASM: #   NumArgs: 0
+; ASM: #   Arguments [
+; ASM: #   ]
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1008                  # Record kind: LF_PROCEDURE
+; ASM: .long	0x3                     # ReturnType
+; ASM: .byte	0x0                     # CallingConvention
+; ASM: .byte	0x0                     # FunctionOptions
+; ASM: .short	0x0                     # NumParameters
+; ASM: .long	0x1000                  # ArgListType
+; ASM: # Procedure (0x1001) {
+; ASM: #   TypeLeafKind: LF_PROCEDURE (0x1008)
+; ASM: #   ReturnType: void (0x3)
+; ASM: #   CallingConvention: NearC (0x0)
+; ASM: #   FunctionOptions [ (0x0)
+; ASM: #   ]
+; ASM: #   NumParameters: 0
+; ASM: #   ArgListType: () (0x1000)
+; ASM: # }
+; ASM: .short	0x16                    # Record length
+; ASM: .short	0x1601                  # Record kind: LF_FUNC_ID
+; ASM: .long	0x0                     # ParentScope
+; ASM: .long	0x1001                  # FunctionType
+; ASM: .asciz	"UseTypes"              # Name
+; ASM: .byte	243
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # FuncId (0x1002) {
+; ASM: #   TypeLeafKind: LF_FUNC_ID (0x1601)
+; ASM: #   ParentScope: 0x0
+; ASM: #   FunctionType: void () (0x1001)
+; ASM: #   Name: UseTypes
+; ASM: # }
+; ASM: .short	0x2a                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x0                     # MemberCount
+; ASM: .short	0x280                   # Properties
+; ASM: .long	0x0                     # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x0                     # SizeOf
+; ASM: .asciz	"Struct"                # Name
+; ASM: .asciz	".?AUStruct@@"          # LinkageName
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # Struct (0x1003) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 0
+; ASM: #   Properties [ (0x280)
+; ASM: #     ForwardReference (0x80)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: 0x0
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 0
+; ASM: #   Name: Struct
+; ASM: #   LinkageName: .?AUStruct@@
+; ASM: # }
+; ASM: .short	0xa                     # Record length
+; ASM: .short	0x1001                  # Record kind: LF_MODIFIER
+; ASM: .long	0x74                    # ModifiedType
+; ASM: .short	0x1                     # Modifiers
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # Modifier (0x1004) {
+; ASM: #   TypeLeafKind: LF_MODIFIER (0x1001)
+; ASM: #   ModifiedType: int (0x74)
+; ASM: #   Modifiers [ (0x1)
+; ASM: #     Const (0x1)
+; ASM: #   ]
+; ASM: # }
+; ASM: .short	0x3e                    # Record length
+; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"s1"                    # Name
+; ASM: .byte	243
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x4                     # FieldOffset
+; ASM: .asciz	"s2"                    # Name
+; ASM: .byte	243
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x8                     # FieldOffset
+; ASM: .asciz	"s3"                    # Name
+; ASM: .byte	243
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: .short	0x150e                  # Member kind: LF_STMEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x1004                  # Type
+; ASM: .asciz	"sdm"                   # Name
+; ASM: # FieldList (0x1005) {
+; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x0
+; ASM: #     Name: s1
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x4
+; ASM: #     Name: s2
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x8
+; ASM: #     Name: s3
+; ASM: #   }
+; ASM: #   StaticDataMember {
+; ASM: #     TypeLeafKind: LF_STMEMBER (0x150E)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: const int (0x1004)
+; ASM: #     Name: sdm
+; ASM: #   }
+; ASM: # }
+; ASM: .short	0x2a                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x4                     # MemberCount
+; ASM: .short	0x200                   # Properties
+; ASM: .long	0x1005                  # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0xc                     # SizeOf
+; ASM: .asciz	"Struct"                # Name
+; ASM: .asciz	".?AUStruct@@"          # LinkageName
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # Struct (0x1006) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 4
+; ASM: #   Properties [ (0x200)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: <field list> (0x1005)
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 12
+; ASM: #   Name: Struct
+; ASM: #   LinkageName: .?AUStruct@@
+; ASM: # }
+; ASM: .short	0x1e                    # Record length
+; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
+; ASM: .long	0x0                     # Id
+; ASM: .asciz	"D:\\src\\llvm\\build\\t.cpp" # StringData
+; ASM: # StringId (0x1007) {
+; ASM: #   TypeLeafKind: LF_STRING_ID (0x1605)
+; ASM: #   Id: 0x0
+; ASM: #   StringData: D:\src\llvm\build\t.cpp
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
+; ASM: .long	0x1006                  # UDT
+; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x1                     # LineNumber
+; ASM: # UdtSourceLine (0x1008) {
+; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; ASM: #   UDT: Struct (0x1006)
+; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
+; ASM: #   LineNumber: 1
+; ASM: # }
+; ASM: .short	0x1e                    # Record length
+; ASM: .short	0x1506                  # Record kind: LF_UNION
+; ASM: .short	0x0                     # MemberCount
+; ASM: .short	0x280                   # Properties
+; ASM: .long	0x0                     # FieldList
+; ASM: .short	0x0                     # SizeOf
+; ASM: .asciz	"Union"                 # Name
+; ASM: .asciz	".?ATUnion@@"           # LinkageName
+; ASM: # Union (0x1009) {
+; ASM: #   TypeLeafKind: LF_UNION (0x1506)
+; ASM: #   MemberCount: 0
+; ASM: #   Properties [ (0x280)
+; ASM: #     ForwardReference (0x80)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: 0x0
+; ASM: #   SizeOf: 0
+; ASM: #   Name: Union
+; ASM: #   LinkageName: .?ATUnion@@
+; ASM: # }
+; ASM: .short	0x1a                    # Record length
+; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"a"                     # Name
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x40                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"b"                     # Name
+; ASM: # FieldList (0x100A) {
+; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x0
+; ASM: #     Name: a
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: float (0x40)
+; ASM: #     FieldOffset: 0x0
+; ASM: #     Name: b
+; ASM: #   }
+; ASM: # }
+; ASM: .short	0x1e                    # Record length
+; ASM: .short	0x1506                  # Record kind: LF_UNION
+; ASM: .short	0x2                     # MemberCount
+; ASM: .short	0x600                   # Properties
+; ASM: .long	0x100a                  # FieldList
+; ASM: .short	0x4                     # SizeOf
+; ASM: .asciz	"Union"                 # Name
+; ASM: .asciz	".?ATUnion@@"           # LinkageName
+; ASM: # Union (0x100B) {
+; ASM: #   TypeLeafKind: LF_UNION (0x1506)
+; ASM: #   MemberCount: 2
+; ASM: #   Properties [ (0x600)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #     Sealed (0x400)
+; ASM: #   ]
+; ASM: #   FieldList: <field list> (0x100A)
+; ASM: #   SizeOf: 4
+; ASM: #   Name: Union
+; ASM: #   LinkageName: .?ATUnion@@
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
+; ASM: .long	0x100b                  # UDT
+; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x7                     # LineNumber
+; ASM: # UdtSourceLine (0x100C) {
+; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; ASM: #   UDT: Union (0x100B)
+; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
+; ASM: #   LineNumber: 7
+; ASM: # }
+; ASM: .short	0x26                    # Record length
+; ASM: .short	0x1504                  # Record kind: LF_CLASS
+; ASM: .short	0x0                     # MemberCount
+; ASM: .short	0x280                   # Properties
+; ASM: .long	0x0                     # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x0                     # SizeOf
+; ASM: .asciz	"Class"                 # Name
+; ASM: .asciz	".?AVClass@@"           # LinkageName
+; ASM: # Class (0x100D) {
+; ASM: #   TypeLeafKind: LF_CLASS (0x1504)
+; ASM: #   MemberCount: 0
+; ASM: #   Properties [ (0x280)
+; ASM: #     ForwardReference (0x80)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: 0x0
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 0
+; ASM: #   Name: Class
+; ASM: #   LinkageName: .?AVClass@@
+; ASM: # }
+; ASM: .short	0x32                    # Record length
+; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"pub"                   # Name
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x1                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x4                     # FieldOffset
+; ASM: .asciz	"priv"                  # Name
+; ASM: .byte	241
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x2                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x8                     # FieldOffset
+; ASM: .asciz	"prot"                  # Name
+; ASM: .byte	241
+; ASM: # FieldList (0x100E) {
+; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x0
+; ASM: #     Name: pub
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Private (0x1)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x4
+; ASM: #     Name: priv
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Protected (0x2)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x8
+; ASM: #     Name: prot
+; ASM: #   }
+; ASM: # }
+; ASM: .short	0x26                    # Record length
+; ASM: .short	0x1504                  # Record kind: LF_CLASS
+; ASM: .short	0x3                     # MemberCount
+; ASM: .short	0x200                   # Properties
+; ASM: .long	0x100e                  # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0xc                     # SizeOf
+; ASM: .asciz	"Class"                 # Name
+; ASM: .asciz	".?AVClass@@"           # LinkageName
+; ASM: # Class (0x100F) {
+; ASM: #   TypeLeafKind: LF_CLASS (0x1504)
+; ASM: #   MemberCount: 3
+; ASM: #   Properties [ (0x200)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: <field list> (0x100E)
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 12
+; ASM: #   Name: Class
+; ASM: #   LinkageName: .?AVClass@@
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
+; ASM: .long	0x100f                  # UDT
+; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0xb                     # LineNumber
+; ASM: # UdtSourceLine (0x1010) {
+; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; ASM: #   UDT: Class (0x100F)
+; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
+; ASM: #   LineNumber: 11
+; ASM: # }
+; ASM: .short	0x36                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x0                     # MemberCount
+; ASM: .short	0x280                   # Properties
+; ASM: .long	0x0                     # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x0                     # SizeOf
+; ASM: .asciz	"DerivedClass"          # Name
+; ASM: .asciz	".?AUDerivedClass@@"    # LinkageName
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # Struct (0x1011) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 0
+; ASM: #   Properties [ (0x280)
+; ASM: #     ForwardReference (0x80)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: 0x0
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 0
+; ASM: #   Name: DerivedClass
+; ASM: #   LinkageName: .?AUDerivedClass@@
+; ASM: # }
+; ASM: .short	0xa                     # Record length
+; ASM: .short	0x1002                  # Record kind: LF_POINTER
+; ASM: .long	0x1004                  # PointeeType
+; ASM: .long	0x1000c                 # Attributes
+; ASM: # Pointer (0x1012) {
+; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
+; ASM: #   PointeeType: const int (0x1004)
+; ASM: #   PtrType: Near64 (0xC)
+; ASM: #   PtrMode: Pointer (0x0)
+; ASM: #   IsFlat: 0
+; ASM: #   IsConst: 0
+; ASM: #   IsVolatile: 0
+; ASM: #   IsUnaligned: 0
+; ASM: #   IsRestrict: 0
+; ASM: #   IsThisPtr&: 0
+; ASM: #   IsThisPtr&&: 0
+; ASM: #   SizeOf: 8
+; ASM: # }
+; ASM: .short	0x6                     # Record length
+; ASM: .short	0xa                     # Record kind: LF_VTSHAPE
+; ASM: .short	0x1                     # VFEntryCount
+; ASM: .byte	0x0
+; ASM: .byte	241
+; ASM: # VFTableShape (0x1013) {
+; ASM: #   TypeLeafKind: LF_VTSHAPE (0xA)
+; ASM: #   VFEntryCount: 1
+; ASM: # }
+; ASM: .short	0xa                     # Record length
+; ASM: .short	0x1002                  # Record kind: LF_POINTER
+; ASM: .long	0x1013                  # PointeeType
+; ASM: .long	0x1000c                 # Attributes
+; ASM: # Pointer (0x1014) {
+; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
+; ASM: #   PointeeType: <vftable 1 methods> (0x1013)
+; ASM: #   PtrType: Near64 (0xC)
+; ASM: #   PtrMode: Pointer (0x0)
+; ASM: #   IsFlat: 0
+; ASM: #   IsConst: 0
+; ASM: #   IsVolatile: 0
+; ASM: #   IsUnaligned: 0
+; ASM: #   IsRestrict: 0
+; ASM: #   IsThisPtr&: 0
+; ASM: #   IsThisPtr&&: 0
+; ASM: #   SizeOf: 8
+; ASM: # }
+; ASM: .short	0x32                    # Record length
+; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
+; ASM: .short	0x1400                  # Member kind: LF_BCLASS
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x1003                  # BaseType
+; ASM: .short	0x0                     # BaseOffset
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: .short	0x1401                  # Member kind: LF_VBCLASS
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x100d                  # BaseType
+; ASM: .long	0x1012                  # VBPtrType
+; ASM: .short	0x0                     # VBPtrOffset
+; ASM: .short	0x1                     # VBTableIndex
+; ASM: .short	0x1409                  # Member kind: LF_VFUNCTAB
+; ASM: .short	0x0                     # Padding
+; ASM: .long	0x1014                  # Type
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x18                    # FieldOffset
+; ASM: .asciz	"d"                     # Name
+; ASM: # FieldList (0x1015) {
+; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
+; ASM: #   BaseClass {
+; ASM: #     TypeLeafKind: LF_BCLASS (0x1400)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     BaseType: Struct (0x1003)
+; ASM: #     BaseOffset: 0x0
+; ASM: #   }
+; ASM: #   VirtualBaseClass {
+; ASM: #     TypeLeafKind: LF_VBCLASS (0x1401)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     BaseType: Class (0x100D)
+; ASM: #     VBPtrType: const int* (0x1012)
+; ASM: #     VBPtrOffset: 0x0
+; ASM: #     VBTableIndex: 0x1
+; ASM: #   }
+; ASM: #   VFPtr {
+; ASM: #     TypeLeafKind: LF_VFUNCTAB (0x1409)
+; ASM: #     Type: <vftable 1 methods>* (0x1014)
+; ASM: #   }
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x18
+; ASM: #     Name: d
+; ASM: #   }
+; ASM: # }
+; ASM: .short	0x36                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x4                     # MemberCount
+; ASM: .short	0x200                   # Properties
+; ASM: .long	0x1015                  # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x30                    # SizeOf
+; ASM: .asciz	"DerivedClass"          # Name
+; ASM: .asciz	".?AUDerivedClass@@"    # LinkageName
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # Struct (0x1016) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 4
+; ASM: #   Properties [ (0x200)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #   ]
+; ASM: #   FieldList: <field list> (0x1015)
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 48
+; ASM: #   Name: DerivedClass
+; ASM: #   LinkageName: .?AUDerivedClass@@
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
+; ASM: .long	0x1016                  # UDT
+; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x14                    # LineNumber
+; ASM: # UdtSourceLine (0x1017) {
+; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; ASM: #   UDT: DerivedClass (0x1016)
+; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
+; ASM: #   LineNumber: 20
+; ASM: # }
+; ASM: .short	0x36                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x0                     # MemberCount
+; ASM: .short	0x288                   # Properties
+; ASM: .long	0x0                     # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x0                     # SizeOf
+; ASM: .asciz	"Class::Nested"         # Name
+; ASM: .asciz	".?AUNested at Class@@"    # LinkageName
+; ASM: .byte	241
+; ASM: # Struct (0x1018) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 0
+; ASM: #   Properties [ (0x288)
+; ASM: #     ForwardReference (0x80)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #     Nested (0x8)
+; ASM: #   ]
+; ASM: #   FieldList: 0x0
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 0
+; ASM: #   Name: Class::Nested
+; ASM: #   LinkageName: .?AUNested at Class@@
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
+; ASM: .short	0x150d                  # Member kind: LF_MEMBER
+; ASM: .short	0x3                     # AccessSpecifier
+; ASM: .long	0x74                    # Type
+; ASM: .short	0x0                     # FieldOffset
+; ASM: .asciz	"n"                     # Name
+; ASM: # FieldList (0x1019) {
+; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
+; ASM: #   DataMember {
+; ASM: #     TypeLeafKind: LF_MEMBER (0x150D)
+; ASM: #     AccessSpecifier: Public (0x3)
+; ASM: #     Type: int (0x74)
+; ASM: #     FieldOffset: 0x0
+; ASM: #     Name: n
+; ASM: #   }
+; ASM: # }
+; ASM: .short	0x36                    # Record length
+; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
+; ASM: .short	0x1                     # MemberCount
+; ASM: .short	0x208                   # Properties
+; ASM: .long	0x1019                  # FieldList
+; ASM: .long	0x0                     # DerivedFrom
+; ASM: .long	0x0                     # VShape
+; ASM: .short	0x4                     # SizeOf
+; ASM: .asciz	"Class::Nested"         # Name
+; ASM: .asciz	".?AUNested at Class@@"    # LinkageName
+; ASM: .byte	241
+; ASM: # Struct (0x101A) {
+; ASM: #   TypeLeafKind: LF_STRUCTURE (0x1505)
+; ASM: #   MemberCount: 1
+; ASM: #   Properties [ (0x208)
+; ASM: #     HasUniqueName (0x200)
+; ASM: #     Nested (0x8)
+; ASM: #   ]
+; ASM: #   FieldList: <field list> (0x1019)
+; ASM: #   DerivedFrom: 0x0
+; ASM: #   VShape: 0x0
+; ASM: #   SizeOf: 4
+; ASM: #   Name: Class::Nested
+; ASM: #   LinkageName: .?AUNested at Class@@
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
+; ASM: .long	0x101a                  # UDT
+; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x17                    # LineNumber
+; ASM: # UdtSourceLine (0x101B) {
+; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
+; ASM: #   UDT: Class::Nested (0x101A)
+; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
+; ASM: #   LineNumber: 23
+; ASM: # }
+; ASM: .short	0xa                     # Record length
+; ASM: .short	0x1002                  # Record kind: LF_POINTER
+; ASM: .long	0x1011                  # PointeeType
+; ASM: .long	0x1040c                 # Attributes
+; ASM: # Pointer (0x101C) {
+; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
+; ASM: #   PointeeType: DerivedClass (0x1011)
+; ASM: #   PtrType: Near64 (0xC)
+; ASM: #   PtrMode: Pointer (0x0)
+; ASM: #   IsFlat: 0
+; ASM: #   IsConst: 1
+; ASM: #   IsVolatile: 0
+; ASM: #   IsUnaligned: 0
+; ASM: #   IsRestrict: 0
+; ASM: #   IsThisPtr&: 0
+; ASM: #   IsThisPtr&&: 0
+; ASM: #   SizeOf: 8
+; ASM: # }
+; ASM: .short	0x1a                    # Record length
+; ASM: .short	0x1009                  # Record kind: LF_MFUNCTION
+; ASM: .long	0x3                     # ReturnType
+; ASM: .long	0x1011                  # ClassType
+; ASM: .long	0x101c                  # ThisType
+; ASM: .byte	0x0                     # CallingConvention
+; ASM: .byte	0x0                     # FunctionOptions
+; ASM: .short	0x0                     # NumParameters
+; ASM: .long	0x1000                  # ArgListType
+; ASM: .long	0x0                     # ThisAdjustment
+; ASM: # MemberFunction (0x101D) {
+; ASM: #   TypeLeafKind: LF_MFUNCTION (0x1009)
+; ASM: #   ReturnType: void (0x3)
+; ASM: #   ClassType: DerivedClass (0x1011)
+; ASM: #   ThisType: DerivedClass* const (0x101C)
+; ASM: #   CallingConvention: NearC (0x0)
+; ASM: #   FunctionOptions [ (0x0)
+; ASM: #   ]
+; ASM: #   NumParameters: 0
+; ASM: #   ArgListType: () (0x1000)
+; ASM: #   ThisAdjustment: 0
+; ASM: # }
+; ASM: .short	0x26                    # Record length
+; ASM: .short	0x1602                  # Record kind: LF_MFUNC_ID
+; ASM: .long	0x1011                  # ClassType
+; ASM: .long	0x101d                  # FunctionType
+; ASM: .asciz	"DerivedClass::DerivedClass" # Name
+; ASM: .byte	241
+; ASM: # MemberFuncId (0x101E) {
+; ASM: #   TypeLeafKind: LF_MFUNC_ID (0x1602)
+; ASM: #   ClassType: DerivedClass (0x1011)
+; ASM: #   FunctionType: void DerivedClass::() (0x101D)
+; ASM: #   Name: DerivedClass::DerivedClass
+; ASM: # }
+; ASM: .short	0xa                     # Record length
+; ASM: .short	0x1002                  # Record kind: LF_POINTER
+; ASM: .long	0x1011                  # PointeeType
+; ASM: .long	0x1000c                 # Attributes
+; ASM: # Pointer (0x101F) {
+; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
+; ASM: #   PointeeType: DerivedClass (0x1011)
+; ASM: #   PtrType: Near64 (0xC)
+; ASM: #   PtrMode: Pointer (0x0)
+; ASM: #   IsFlat: 0
+; ASM: #   IsConst: 0
+; ASM: #   IsVolatile: 0
+; ASM: #   IsUnaligned: 0
+; ASM: #   IsRestrict: 0
+; ASM: #   IsThisPtr&: 0
+; ASM: #   IsThisPtr&&: 0
+; ASM: #   SizeOf: 8
+; ASM: # }
+; ASM: .short	0x1a                    # Record length
+; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
+; ASM: .long	0x0                     # Id
+; ASM: .asciz	"D:\\src\\llvm\\build"  # StringData
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # StringId (0x1020) {
+; ASM: #   TypeLeafKind: LF_STRING_ID (0x1605)
+; ASM: #   Id: 0x0
+; ASM: #   StringData: D:\src\llvm\build
+; ASM: # }
+; ASM: .short	0xe                     # Record length
+; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
+; ASM: .long	0x0                     # Id
+; ASM: .asciz	"t.cpp"                 # StringData
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # StringId (0x1021) {
+; ASM: #   TypeLeafKind: LF_STRING_ID (0x1605)
+; ASM: #   Id: 0x0
+; ASM: #   StringData: t.cpp
+; ASM: # }
+; ASM: .short	0x1a                    # Record length
+; ASM: .short	0x1603                  # Record kind: LF_BUILDINFO
+; ASM: .short	0x5                     # NumArgs
+; ASM: .long	0x1020                  # Argument
+; ASM: .long	0x0                     # Argument
+; ASM: .long	0x1021                  # Argument
+; ASM: .long	0x0                     # Argument
+; ASM: .long	0x0                     # Argument
+; ASM: .byte	242
+; ASM: .byte	241
+; ASM: # BuildInfo (0x1022) {
+; ASM: #   TypeLeafKind: LF_BUILDINFO (0x1603)
+; ASM: #   NumArgs: 5
+; ASM: #   Arguments [
+; ASM: #     ArgType: D:\src\llvm\build (0x1020)
+; ASM: #     ArgType: 0x0
+; ASM: #     ArgType: t.cpp (0x1021)
+; ASM: #     ArgType: 0x0
+; ASM: #     ArgType: 0x0
+; ASM: #   ]
+; ASM: # }
+
 ; ModuleID = 't.cpp'
 source_filename = "t.cpp"
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"




More information about the llvm-commits mailing list