<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 22, 2016 at 10:15 AM, Reid Kleckner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Wed Jun 22 12:15:28 2016<br>
New Revision: 273443<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=273443&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=273443&view=rev</a><br>
Log:<br>
[codeview] Defer emission of all referenced complete records<br>
<br>
This is the motivating example:<br>
  struct B { int b; };<br>
  struct A { B *b; };<br>
  int f(A *p) { return p->b->b; }<br>
<br>
Clang emits complete types for both A and B because they are required to<br>
be complete, but our CodeView emission would only emit forward<br>
declarations of A and B. This was a consequence of the fact that the A*<br>
type must reference the forward declaration of A, which doesn't<br>
reference B at all.<br>
<br>
We can't eagerly emit complete definitions of A and B when we request<br>
the forward declaration's type index because of recursive types like<br>
linked lists. If we did that, our stack usage could get out of hand, and<br>
it would be possible to lower a type while attempting to lower a type,<br>
and we would need to double check if our type is already present in the<br>
TypeIndexMap after all recursive getTypeIndex calls.<br>
<br>
Instead, defer complete type emission until after all type lowering has<br>
completed. This ensures that all referenced complete types are emitted,<br>
and that type lowering is not re-entrant.<br></blockquote><div><br></div><div>Does this make debug info larger by emitting forward declarations for every type, even when they aren't necessary? (this would certainly happen if we did this in DWARF emission - so just wondering how it compares). Any idea how much of a penalty that is for CV size?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Added:<br>
    llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h<br>
    llvm/trunk/test/DebugInfo/COFF/types-basic.ll<br>
    llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=273443&r1=273442&r2=273443&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=273443&r1=273442&r2=273443&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Wed Jun 22 12:15:28 2016<br>
@@ -1400,6 +1400,8 @@ TypeIndex CodeViewDebug::lowerTypeClass(<br>
   TypeIndex FwdDeclTI = TypeTable.writeClass(ClassRecord(<br>
       Kind, 0, CO, HfaKind::None, WindowsRTClassKind::None, TypeIndex(),<br>
       TypeIndex(), TypeIndex(), 0, FullName, Ty->getIdentifier()));<br>
+  if (!Ty->isForwardDecl())<br>
+    DeferredCompleteTypes.push_back(Ty);<br>
   return FwdDeclTI;<br>
 }<br>
<br>
@@ -1431,6 +1433,8 @@ TypeIndex CodeViewDebug::lowerTypeUnion(<br>
   TypeIndex FwdDeclTI =<br>
       TypeTable.writeUnion(UnionRecord(0, CO, HfaKind::None, TypeIndex(), 0,<br>
                                        FullName, Ty->getIdentifier()));<br>
+  if (!Ty->isForwardDecl())<br>
+    DeferredCompleteTypes.push_back(Ty);<br>
   return FwdDeclTI;<br>
 }<br>
<br>
@@ -1518,6 +1522,18 @@ CodeViewDebug::lowerRecordFieldList(cons<br>
   return std::make_tuple(FieldTI, TypeIndex(), MemberCount);<br>
 }<br>
<br>
+struct CodeViewDebug::TypeLoweringScope {<br>
+  TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }<br>
+  ~TypeLoweringScope() {<br>
+    // Don't decrement TypeEmissionLevel until after emitting deferred types, so<br>
+    // inner TypeLoweringScopes don't attempt to emit deferred types.<br>
+    if (CVD.TypeEmissionLevel == 1)<br>
+      CVD.emitDeferredCompleteTypes();<br>
+    --CVD.TypeEmissionLevel;<br>
+  }<br>
+  CodeViewDebug &CVD;<br>
+};<br>
+<br>
 TypeIndex CodeViewDebug::getTypeIndex(DITypeRef TypeRef, DITypeRef ClassTyRef) {<br>
   const DIType *Ty = TypeRef.resolve();<br>
   const DIType *ClassTy = ClassTyRef.resolve();<br>
@@ -1533,9 +1549,14 @@ TypeIndex CodeViewDebug::getTypeIndex(DI<br>
   if (I != TypeIndices.end())<br>
     return I->second;<br>
<br>
-  TypeIndex TI = lowerType(Ty, ClassTy);<br>
+  TypeIndex TI;<br>
+  {<br>
+    TypeLoweringScope S(*this);<br>
+    TI = lowerType(Ty, ClassTy);<br>
+    recordTypeIndexForDINode(Ty, TI, ClassTy);<br>
+  }<br>
<br>
-  return recordTypeIndexForDINode(Ty, TI, ClassTy);<br>
+  return TI;<br>
 }<br>
<br>
 TypeIndex CodeViewDebug::getCompleteTypeIndex(DITypeRef TypeRef) {<br>
@@ -1564,6 +1585,8 @@ TypeIndex CodeViewDebug::getCompleteType<br>
   if (!InsertResult.second)<br>
     return InsertResult.first->second;<br>
<br>
+  TypeLoweringScope S(*this);<br>
+<br>
   // Make sure the forward declaration is emitted first. It's unclear if this<br>
   // is necessary, but MSVC does it, and we should follow suit until we can show<br>
   // otherwise.<br>
@@ -1592,6 +1615,19 @@ TypeIndex CodeViewDebug::getCompleteType<br>
   return TI;<br>
 }<br>
<br>
+/// Emit all the deferred complete record types. Try to do this in FIFO order,<br>
+/// and do this until fixpoint, as each complete record type typically references<br>
+/// many other record types.<br>
+void CodeViewDebug::emitDeferredCompleteTypes() {<br>
+  SmallVector<const DICompositeType *, 4> TypesToEmit;<br>
+  while (!DeferredCompleteTypes.empty()) {<br>
+    std::swap(DeferredCompleteTypes, TypesToEmit);<br>
+    for (const DICompositeType *RecordTy : TypesToEmit)<br>
+      getCompleteTypeIndex(RecordTy);<br>
+    TypesToEmit.clear();<br>
+  }<br>
+}<br>
+<br>
 void CodeViewDebug::emitLocalVariable(const LocalVariable &Var) {<br>
   // LocalSym record, see SymbolRecord.h for more info.<br>
   MCSymbol *LocalBegin = MMI->getContext().createTempSymbol(),<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h?rev=273443&r1=273442&r2=273443&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h?rev=273443&r1=273442&r2=273443&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.h Wed Jun 22 12:15:28 2016<br>
@@ -150,6 +150,13 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDe<br>
   /// always looked up in the normal TypeIndices map.<br>
   DenseMap<const DICompositeType *, codeview::TypeIndex> CompleteTypeIndices;<br>
<br>
+  /// Complete record types to emit after all active type lowerings are<br>
+  /// finished.<br>
+  SmallVector<const DICompositeType *, 4> DeferredCompleteTypes;<br>
+<br>
+  /// Number of type lowering frames active on the stack.<br>
+  unsigned TypeEmissionLevel = 0;<br>
+<br>
   const DISubprogram *CurrentSubprogram = nullptr;<br>
<br>
   // The UDTs we have seen while processing types; each entry is a pair of type<br>
@@ -246,6 +253,10 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDe<br>
   codeview::TypeIndex lowerCompleteTypeClass(const DICompositeType *Ty);<br>
   codeview::TypeIndex lowerCompleteTypeUnion(const DICompositeType *Ty);<br>
<br>
+  struct TypeLoweringScope;<br>
+<br>
+  void emitDeferredCompleteTypes();<br>
+<br>
   void collectMemberInfo(ClassInfo &Info, const DIDerivedType *DDTy);<br>
   ClassInfo collectClassInfo(const DICompositeType *Ty);<br>
<br>
<br>
Added: llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll?rev=273443&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll?rev=273443&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll (added)<br>
+++ llvm/trunk/test/DebugInfo/COFF/defer-complete-type.ll Wed Jun 22 12:15:28 2016<br>
@@ -0,0 +1,193 @@<br>
+; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s<br>
+<br>
+; Both A and B should get forward declarations and complete definitions for this<br>
+; example.<br>
+<br>
+; C++ source to regenerate:<br>
+; $ cat t.cpp<br>
+; struct B { int b; };<br>
+; struct A { B *b; };<br>
+; int f(A *p) { return p->b->b; }<br>
+; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll<br>
+<br>
+; CHECK: CodeViewTypes [<br>
+; CHECK:   Section: .debug$T (6)<br>
+; CHECK:   Magic: 0x4<br>
+; CHECK:   Struct (0x1000) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 0<br>
+; CHECK:     Properties [ (0x280)<br>
+; CHECK:       ForwardReference (0x80)<br>
+; CHECK:       HasUniqueName (0x200)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: 0x0<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 0<br>
+; CHECK:     Name: A<br>
+; CHECK:     LinkageName: .?AUA@@<br>
+; CHECK:   }<br>
+; CHECK:   Pointer (0x1001) {<br>
+; CHECK:     TypeLeafKind: LF_POINTER (0x1002)<br>
+; CHECK:     PointeeType: A (0x1000)<br>
+; CHECK:     PointerAttributes: 0x1000C<br>
+; CHECK:     PtrType: Near64 (0xC)<br>
+; CHECK:     PtrMode: Pointer (0x0)<br>
+; CHECK:     IsFlat: 0<br>
+; CHECK:     IsConst: 0<br>
+; CHECK:     IsVolatile: 0<br>
+; CHECK:     IsUnaligned: 0<br>
+; CHECK:     SizeOf: 8<br>
+; CHECK:   }<br>
+; CHECK:   ArgList (0x1002) {<br>
+; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)<br>
+; CHECK:     NumArgs: 1<br>
+; CHECK:     Arguments [<br>
+; CHECK:       ArgType: A* (0x1001)<br>
+; CHECK:     ]<br>
+; CHECK:   }<br>
+; CHECK:   Procedure (0x1003) {<br>
+; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
+; CHECK:     ReturnType: int (0x74)<br>
+; CHECK:     CallingConvention: NearC (0x0)<br>
+; CHECK:     FunctionOptions [ (0x0)<br>
+; CHECK:     ]<br>
+; CHECK:     NumParameters: 1<br>
+; CHECK:     ArgListType: (A*) (0x1002)<br>
+; CHECK:   }<br>
+; CHECK:   Struct (0x1004) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 0<br>
+; CHECK:     Properties [ (0x280)<br>
+; CHECK:       ForwardReference (0x80)<br>
+; CHECK:       HasUniqueName (0x200)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: 0x0<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 0<br>
+; CHECK:     Name: B<br>
+; CHECK:     LinkageName: .?AUB@@<br>
+; CHECK:   }<br>
+; CHECK:   Pointer (0x1005) {<br>
+; CHECK:     TypeLeafKind: LF_POINTER (0x1002)<br>
+; CHECK:     PointeeType: B (0x1004)<br>
+; CHECK:     PointerAttributes: 0x1000C<br>
+; CHECK:     PtrType: Near64 (0xC)<br>
+; CHECK:     PtrMode: Pointer (0x0)<br>
+; CHECK:     IsFlat: 0<br>
+; CHECK:     IsConst: 0<br>
+; CHECK:     IsVolatile: 0<br>
+; CHECK:     IsUnaligned: 0<br>
+; CHECK:     SizeOf: 8<br>
+; CHECK:   }<br>
+; CHECK:   FieldList (0x1006) {<br>
+; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)<br>
+; CHECK:     DataMember {<br>
+; CHECK:       AccessSpecifier: Public (0x3)<br>
+; CHECK:       Type: B* (0x1005)<br>
+; CHECK:       FieldOffset: 0x0<br>
+; CHECK:       Name: b<br>
+; CHECK:     }<br>
+; CHECK:   }<br>
+; CHECK:   Struct (0x1007) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 1<br>
+; CHECK:     Properties [ (0x200)<br>
+; CHECK:       HasUniqueName (0x200)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: <field list> (0x1006)<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 8<br>
+; CHECK:     Name: A<br>
+; CHECK:     LinkageName: .?AUA@@<br>
+; CHECK:   }<br>
+; CHECK:   FieldList (0x1008) {<br>
+; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)<br>
+; CHECK:     DataMember {<br>
+; CHECK:       AccessSpecifier: Public (0x3)<br>
+; CHECK:       Type: int (0x74)<br>
+; CHECK:       FieldOffset: 0x0<br>
+; CHECK:       Name: b<br>
+; CHECK:     }<br>
+; CHECK:   }<br>
+; CHECK:   Struct (0x1009) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 1<br>
+; CHECK:     Properties [ (0x200)<br>
+; CHECK:       HasUniqueName (0x200)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: <field list> (0x1008)<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 4<br>
+; CHECK:     Name: B<br>
+; CHECK:     LinkageName: .?AUB@@<br>
+; CHECK:   }<br>
+; CHECK:   FuncId (0x100A) {<br>
+; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
+; CHECK:     ParentScope: 0x0<br>
+; CHECK:     FunctionType: int (A*) (0x1003)<br>
+; CHECK:     Name: f<br>
+; CHECK:   }<br>
+; CHECK: ]<br>
+<br>
+; ModuleID = 't.cpp'<br>
+source_filename = "t.cpp"<br>
+target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"<br>
+target triple = "x86_64-pc-windows-msvc19.0.23918"<br>
+<br>
+%struct.A = type { %struct.B* }<br>
+%struct.B = type { i32 }<br>
+<br>
+; Function Attrs: nounwind uwtable<br>
+define i32 @"\01?f@@YAHPEAUA@@@Z"(%struct.A* %p) #0 !dbg !7 {<br>
+entry:<br>
+  %p.addr = alloca %struct.A*, align 8<br>
+  store %struct.A* %p, %struct.A** %p.addr, align 8<br>
+  call void @llvm.dbg.declare(metadata %struct.A** %p.addr, metadata !19, metadata !20), !dbg !21<br>
+  %0 = load %struct.A*, %struct.A** %p.addr, align 8, !dbg !22<br>
+  %b = getelementptr inbounds %struct.A, %struct.A* %0, i32 0, i32 0, !dbg !23<br>
+  %1 = load %struct.B*, %struct.B** %b, align 8, !dbg !23<br>
+  %b1 = getelementptr inbounds %struct.B, %struct.B* %1, i32 0, i32 0, !dbg !24<br>
+  %2 = load i32, i32* %b1, align 4, !dbg !24<br>
+  ret i32 %2, !dbg !25<br>
+}<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
+<br>
+attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #1 = { nounwind readnone }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
+!llvm.module.flags = !{!3, !4, !5}<br>
+!llvm.ident = !{!6}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)<br>
+!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")<br>
+!2 = !{}<br>
+!3 = !{i32 2, !"CodeView", i32 1}<br>
+!4 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!5 = !{i32 1, !"PIC Level", i32 2}<br>
+!6 = !{!"clang version 3.9.0 "}<br>
+!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHPEAUA@@@Z", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)<br>
+!8 = !DISubroutineType(types: !9)<br>
+!9 = !{!10, !11}<br>
+!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64)<br>
+!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 2, size: 64, align: 64, elements: !13, identifier: ".?AUA@@")<br>
+!13 = !{!14}<br>
+!14 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !12, file: !1, line: 2, baseType: !15, size: 64, align: 64)<br>
+!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, align: 64)<br>
+!16 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 1, size: 32, align: 32, elements: !17, identifier: ".?AUB@@")<br>
+!17 = !{!18}<br>
+!18 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !16, file: !1, line: 1, baseType: !10, size: 32, align: 32)<br>
+!19 = !DILocalVariable(name: "p", arg: 1, scope: !7, file: !1, line: 3, type: !11)<br>
+!20 = !DIExpression()<br>
+!21 = !DILocation(line: 3, column: 10, scope: !7)<br>
+!22 = !DILocation(line: 3, column: 22, scope: !7)<br>
+!23 = !DILocation(line: 3, column: 25, scope: !7)<br>
+!24 = !DILocation(line: 3, column: 28, scope: !7)<br>
+!25 = !DILocation(line: 3, column: 15, scope: !7)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/COFF/types-basic.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-basic.ll?rev=273443&r1=273442&r2=273443&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-basic.ll?rev=273443&r1=273442&r2=273443&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/COFF/types-basic.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/COFF/types-basic.ll Wed Jun 22 12:15:28 2016<br>
@@ -119,19 +119,44 @@<br>
 ; CHECK:     Arguments [<br>
 ; CHECK:     ]<br>
 ; CHECK:   }<br>
-; CHECK:  MemberFunction (0x1009) {<br>
-; CHECK:    TypeLeafKind: LF_MFUNCTION (0x1009)<br>
-; CHECK:    ReturnType: void (0x3)<br>
-; CHECK:    ClassType: A (0x1005)<br>
-; CHECK:    ThisType: A* (0x1007)<br>
-; CHECK:    CallingConvention: NearC (0x0)<br>
-; CHECK:    FunctionOptions [ (0x0)<br>
-; CHECK:    ]<br>
-; CHECK:    NumParameters: 0<br>
-; CHECK:    ArgListType: () (0x1008)<br>
-; CHECK:    ThisAdjustment: 0<br>
-; CHECK:  }<br>
-; CHECK:   Pointer (0x100A) {<br>
+; CHECK:   MemberFunction (0x1009) {<br>
+; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)<br>
+; CHECK:     ReturnType: void (0x3)<br>
+; CHECK:     ClassType: A (0x1005)<br>
+; CHECK:     ThisType: A* (0x1007)<br>
+; CHECK:     CallingConvention: NearC (0x0)<br>
+; CHECK:     FunctionOptions [ (0x0)<br>
+; CHECK:     ]<br>
+; CHECK:     NumParameters: 0<br>
+; CHECK:     ArgListType: () (0x1008)<br>
+; CHECK:     ThisAdjustment: 0<br>
+; CHECK:   }<br>
+; CHECK:   FieldList (0x100A) {<br>
+; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)<br>
+; CHECK:     DataMember {<br>
+; CHECK:       AccessSpecifier: Public (0x3)<br>
+; CHECK:       Type: int (0x74)<br>
+; CHECK:       FieldOffset: 0x0<br>
+; CHECK:       Name: a<br>
+; CHECK:     }<br>
+; CHECK:     OneMethod {<br>
+; CHECK:       AccessSpecifier: Public (0x3)<br>
+; CHECK:       Type: void A::() (0x1009)<br>
+; CHECK:       Name: A::f<br>
+; CHECK:     }<br>
+; CHECK:   }<br>
+; CHECK:   Struct (0x100B) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 2<br>
+; CHECK:     Properties [ (0x0)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: <field list> (0x100A)<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 4<br>
+; CHECK:     Name: A<br>
+; CHECK:   }<br>
+; CHECK:   Pointer (0x100C) {<br>
 ; CHECK:     TypeLeafKind: LF_POINTER (0x1002)<br>
 ; CHECK:     PointeeType: void A::() (0x1009)<br>
 ; CHECK:     PointerAttributes: 0x1006C<br>
@@ -144,16 +169,16 @@<br>
 ; CHECK:     ClassType: A (0x1005)<br>
 ; CHECK:     Representation: GeneralFunction (0x8)<br>
 ; CHECK:   }<br>
-; CHECK:   Modifier (0x100B) {<br>
+; CHECK:   Modifier (0x100D) {<br>
 ; CHECK:     TypeLeafKind: LF_MODIFIER (0x1001)<br>
 ; CHECK:     ModifiedType: void (0x3)<br>
 ; CHECK:     Modifiers [ (0x1)<br>
 ; CHECK:       Const (0x1)<br>
 ; CHECK:     ]<br>
 ; CHECK:   }<br>
-; CHECK:   Pointer (0x100C) {<br>
+; CHECK:   Pointer (0x100E) {<br>
 ; CHECK:     TypeLeafKind: LF_POINTER (0x1002)<br>
-; CHECK:     PointeeType: const void (0x100B)<br>
+; CHECK:     PointeeType: const void (0x100D)<br>
 ; CHECK:     PointerAttributes: 0x1000C<br>
 ; CHECK:     PtrType: Near64 (0xC)<br>
 ; CHECK:     PtrMode: Pointer (0x0)<br>
@@ -162,7 +187,7 @@<br>
 ; CHECK:     IsVolatile: 0<br>
 ; CHECK:     IsUnaligned: 0<br>
 ; CHECK:   }<br>
-; CHECK:   Procedure (0x100D) {<br>
+; CHECK:   Procedure (0x100F) {<br>
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
 ; CHECK:     ReturnType: void (0x3)<br>
 ; CHECK:     CallingConvention: NearC (0x0)<br>
@@ -171,10 +196,10 @@<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1008)<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x100E) {<br>
+; CHECK:   FuncId (0x1010) {<br>
 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
 ; CHECK:     ParentScope: 0x0<br>
-; CHECK:     FunctionType: void () (0x100D)<br>
+; CHECK:     FunctionType: void () (0x100F)<br>
 ; CHECK:     Name: CharTypes<br>
 ; CHECK:   }<br>
 ; CHECK: ]<br>
@@ -235,7 +260,7 @@<br>
 ; CHECK:       VarName: v4<br>
 ; CHECK:     }<br>
 ; CHECK:     Local {<br>
-; CHECK:       Type: void A::() A::* (0x100A)<br>
+; CHECK:       Type: void A::() A::* (0x100C)<br>
 ; CHECK:       VarName: v5<br>
 ; CHECK:     }<br>
 ; CHECK:     Local {<br>
@@ -255,7 +280,7 @@<br>
 ; CHECK:       VarName: l4<br>
 ; CHECK:     }<br>
 ; CHECK:     Local {<br>
-; CHECK:       Type: const void* (0x100C)<br>
+; CHECK:       Type: const void* (0x100E)<br>
 ; CHECK:       VarName: v6<br>
 ; CHECK:     }<br>
 ; CHECK:     ProcEnd {<br>
@@ -263,7 +288,7 @@<br>
 ; CHECK:   ]<br>
 ; CHECK:   Subsection [<br>
 ; CHECK:     ProcStart {<br>
-; CHECK:       Type: CharTypes (0x100E)<br>
+; CHECK:       Type: CharTypes (0x1010)<br>
 ; CHECK:       DisplayName: CharTypes<br>
 ; CHECK:       LinkageName: ?CharTypes@@YAXXZ<br>
 ; CHECK:     }<br>
<br>
Modified: llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll?rev=273443&r1=273442&r2=273443&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll?rev=273443&r1=273442&r2=273443&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/COFF/types-calling-conv.ll Wed Jun 22 12:15:28 2016<br>
@@ -37,6 +37,7 @@<br>
 ; CHECK:     IsConst: 0<br>
 ; CHECK:     IsVolatile: 0<br>
 ; CHECK:     IsUnaligned: 0<br>
+; CHECK:     SizeOf: 4<br>
 ; CHECK:   }<br>
 ; CHECK:   ArgList (0x1002) {<br>
 ; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)<br>
@@ -54,14 +55,34 @@<br>
 ; CHECK:     ]<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1002)<br>
+; CHECK:     ThisAdjustment: 0<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x1004) {<br>
+; CHECK:   FieldList (0x1004) {<br>
+; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)<br>
+; CHECK:     OneMethod {<br>
+; CHECK:       AccessSpecifier: Public (0x3)<br>
+; CHECK:       Type: void A::() (0x1003)<br>
+; CHECK:       Name: A::thiscallcc<br>
+; CHECK:     }<br>
+; CHECK:   }<br>
+; CHECK:   Struct (0x1005) {<br>
+; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)<br>
+; CHECK:     MemberCount: 1<br>
+; CHECK:     Properties [ (0x0)<br>
+; CHECK:     ]<br>
+; CHECK:     FieldList: <field list> (0x1004)<br>
+; CHECK:     DerivedFrom: 0x0<br>
+; CHECK:     VShape: 0x0<br>
+; CHECK:     SizeOf: 1<br>
+; CHECK:     Name: A<br>
+; CHECK:   }<br>
+; CHECK:   MemberFuncId (0x1006) {<br>
 ; CHECK:     TypeLeafKind: LF_MFUNC_ID (0x1602)<br>
 ; CHECK:     ClassType: A (0x1000)<br>
 ; CHECK:     FunctionType: void A::() (0x1003)<br>
 ; CHECK:     Name: A::thiscallcc<br>
 ; CHECK:   }<br>
-; CHECK:   Procedure (0x1005) {<br>
+; CHECK:   Procedure (0x1007) {<br>
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
 ; CHECK:     ReturnType: void (0x3)<br>
 ; CHECK:     CallingConvention: NearC (0x0)<br>
@@ -70,13 +91,13 @@<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1002)<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x1006) {<br>
+; CHECK:   FuncId (0x1008) {<br>
 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
 ; CHECK:     ParentScope: 0x0<br>
-; CHECK:     FunctionType: void () (0x1005)<br>
+; CHECK:     FunctionType: void () (0x1007)<br>
 ; CHECK:     Name: cdeclcc<br>
 ; CHECK:   }<br>
-; CHECK:   Procedure (0x1007) {<br>
+; CHECK:   Procedure (0x1009) {<br>
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
 ; CHECK:     ReturnType: void (0x3)<br>
 ; CHECK:     CallingConvention: NearFast (0x4)<br>
@@ -85,13 +106,13 @@<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1002)<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x1008) {<br>
+; CHECK:   FuncId (0x100A) {<br>
 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
 ; CHECK:     ParentScope: 0x0<br>
-; CHECK:     FunctionType: void () (0x1007)<br>
+; CHECK:     FunctionType: void () (0x1009)<br>
 ; CHECK:     Name: fastcallcc<br>
 ; CHECK:   }<br>
-; CHECK:   Procedure (0x1009) {<br>
+; CHECK:   Procedure (0x100B) {<br>
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
 ; CHECK:     ReturnType: void (0x3)<br>
 ; CHECK:     CallingConvention: NearStdCall (0x7)<br>
@@ -100,13 +121,13 @@<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1002)<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x100A) {<br>
+; CHECK:   FuncId (0x100C) {<br>
 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
 ; CHECK:     ParentScope: 0x0<br>
-; CHECK:     FunctionType: void () (0x1009)<br>
+; CHECK:     FunctionType: void () (0x100B)<br>
 ; CHECK:     Name: stdcallcc<br>
 ; CHECK:   }<br>
-; CHECK:   Procedure (0x100B) {<br>
+; CHECK:   Procedure (0x100D) {<br>
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)<br>
 ; CHECK:     ReturnType: void (0x3)<br>
 ; CHECK:     CallingConvention: NearVector (0x18)<br>
@@ -115,10 +136,10 @@<br>
 ; CHECK:     NumParameters: 0<br>
 ; CHECK:     ArgListType: () (0x1002)<br>
 ; CHECK:   }<br>
-; CHECK:   FuncId (0x100C) {<br>
+; CHECK:   FuncId (0x100E) {<br>
 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)<br>
 ; CHECK:     ParentScope: 0x0<br>
-; CHECK:     FunctionType: void () (0x100B)<br>
+; CHECK:     FunctionType: void () (0x100D)<br>
 ; CHECK:     Name: vectorcallcc<br>
 ; CHECK:   }<br>
 ; CHECK: ]<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>