From 2fd14ed24de281ec8d80157e20b6f3b7798bcf47 Mon Sep 17 00:00:00 2001 From: Brock Wyma Date: Thu, 1 Feb 2018 20:37:38 +0000 Subject: [PATCH] [CodeView] Class record member counts should include base classes and ... Increment the field list member count for base classes and virtual base classes. Differential Revision: https://reviews.llvm.org/D41874 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324000 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 2 ++ test/DebugInfo/COFF/types-data-members.ll | 2 +- test/DebugInfo/COFF/vftables.ll | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index e616b6341c5..f1749fb6915 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1970,6 +1970,7 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) { VBTableIndex); ContinuationBuilder.writeMemberType(VBCR); + MemberCount++; } else { assert(I->getOffsetInBits() % 8 == 0 && "bases must be on byte boundaries"); @@ -1977,6 +1978,7 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) { getTypeIndex(I->getBaseType()), I->getOffsetInBits() / 8); ContinuationBuilder.writeMemberType(BCR); + MemberCount++; } } diff --git a/test/DebugInfo/COFF/types-data-members.ll b/test/DebugInfo/COFF/types-data-members.ll index 275af969a48..be8386b6543 100644 --- a/test/DebugInfo/COFF/types-data-members.ll +++ b/test/DebugInfo/COFF/types-data-members.ll @@ -298,7 +298,7 @@ ; CHECK: } ; CHECK: Struct (0x1016) { ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) -; CHECK: MemberCount: 2 +; CHECK: MemberCount: 4 ; CHECK: Properties [ (0x200) ; CHECK: HasUniqueName (0x200) ; CHECK: ] diff --git a/test/DebugInfo/COFF/vftables.ll b/test/DebugInfo/COFF/vftables.ll index ebb64738143..ba6d9d5f40c 100644 --- a/test/DebugInfo/COFF/vftables.ll +++ b/test/DebugInfo/COFF/vftables.ll @@ -117,11 +117,9 @@ ; CHECK-NEXT: } ; CHECK-NOT: VFPtr -; FIXME: Is the MemberCount correct? - ; CHECK: Struct ({{.*}}) { ; CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505) -; CHECK-NEXT: MemberCount: 3 +; CHECK-NEXT: MemberCount: 5 ; CHECK-NEXT: Properties [ (0x200) ; CHECK-NEXT: HasUniqueName (0x200) ; CHECK-NEXT: ] @@ -145,7 +143,7 @@ ; CHECK: Struct ({{.*}}) { ; CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505) -; CHECK-NEXT: MemberCount: 3 +; CHECK-NEXT: MemberCount: 4 ; CHECK-NEXT: Properties [ (0x200) ; CHECK-NEXT: HasUniqueName (0x200) ; CHECK-NEXT: ] -- 2.11.0