mirror of https://github.com/microsoft/clang.git
[CodeView] Improve debugging of virtual base class member variables
Initial support for passing the virtual base pointer offset to CodeViewDebug. https://reviews.llvm.org/D46271 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
32f603c589
commit
1ac7096910
|
@ -1536,6 +1536,7 @@ void CGDebugInfo::CollectCXXBasesAux(
|
|||
auto *BaseTy = getOrCreateType(BI.getType(), Unit);
|
||||
llvm::DINode::DIFlags BFlags = StartingFlags;
|
||||
uint64_t BaseOffset;
|
||||
uint32_t VBPtrOffset = 0;
|
||||
|
||||
if (BI.isVirtual()) {
|
||||
if (CGM.getTarget().getCXXABI().isItaniumFamily()) {
|
||||
|
@ -1549,6 +1550,8 @@ void CGDebugInfo::CollectCXXBasesAux(
|
|||
// vbase offset offset in Itanium.
|
||||
BaseOffset =
|
||||
4 * CGM.getMicrosoftVTableContext().getVBTableIndex(RD, Base);
|
||||
VBPtrOffset = CGM.getContext().getASTRecordLayout(RD).getVBPtrOffset()
|
||||
.getQuantity();
|
||||
}
|
||||
BFlags |= llvm::DINode::FlagVirtual;
|
||||
} else
|
||||
|
@ -1558,7 +1561,8 @@ void CGDebugInfo::CollectCXXBasesAux(
|
|||
|
||||
BFlags |= getAccessFlag(BI.getAccessSpecifier(), RD);
|
||||
llvm::DIType *DTy =
|
||||
DBuilder.createInheritance(RecordTy, BaseTy, BaseOffset, BFlags);
|
||||
DBuilder.createInheritance(RecordTy, BaseTy, BaseOffset, VBPtrOffset,
|
||||
BFlags);
|
||||
EltTys.push_back(DTy);
|
||||
}
|
||||
}
|
||||
|
@ -2192,7 +2196,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const ObjCInterfaceType *Ty,
|
|||
if (!SClassTy)
|
||||
return nullptr;
|
||||
|
||||
llvm::DIType *InhTag = DBuilder.createInheritance(RealDecl, SClassTy, 0,
|
||||
llvm::DIType *InhTag = DBuilder.createInheritance(RealDecl, SClassTy, 0, 0,
|
||||
llvm::DINode::FlagZero);
|
||||
EltTys.push_back(InhTag);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ struct A {
|
|||
};
|
||||
|
||||
|
||||
// CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: ![[A]],{{.*}} flags: DIFlagPublic)
|
||||
// CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: ![[A]],{{.*}} flags: DIFlagPublic, extraData: i32 0)
|
||||
class B : public A {
|
||||
public:
|
||||
// CHECK-DAG: !DISubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// CHECK: ![[elements]] = !{![[NoPrimaryBase_base:[0-9]+]]}
|
||||
|
||||
// CHECK: ![[NoPrimaryBase_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[NoPrimaryBase]],
|
||||
// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual)
|
||||
// CHECK-SAME: baseType: ![[HasVirtualMethod:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0)
|
||||
|
||||
// CHECK: ![[HasVirtualMethod]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasVirtualMethod"
|
||||
|
||||
|
@ -18,11 +18,11 @@
|
|||
// CHECK: ![[elements]] = !{![[SecondaryVTable_base:[0-9]+]], ![[HasVirtualMethod_base:[0-9]+]], ![[vshape:[0-9]+]]}
|
||||
|
||||
// CHECK: ![[SecondaryVTable_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]],
|
||||
// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual)
|
||||
// CHECK-SAME: baseType: ![[SecondaryVTable:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 4)
|
||||
|
||||
// CHECK: ![[SecondaryVTable]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "SecondaryVTable"
|
||||
|
||||
// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]])
|
||||
// CHECK: ![[HasVirtualMethod_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[HasPrimaryBase]], baseType: ![[HasVirtualMethod]], extraData: i32 0)
|
||||
|
||||
// CHECK: ![[HasIndirectVirtualBase:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasIndirectVirtualBase"
|
||||
// CHECK-SAME: elements: ![[elements:[0-9]+]]
|
||||
|
@ -41,7 +41,7 @@
|
|||
// CHECK: ![[elements]] = !{![[POD_base:[0-9]+]]}
|
||||
|
||||
// CHECK: ![[POD_base]] = !DIDerivedType(tag: DW_TAG_inheritance, scope: ![[DynamicNoVFPtr]],
|
||||
// CHECK-SAME: baseType: ![[POD:[0-9]+]], offset: 4, flags: DIFlagVirtual)
|
||||
// CHECK-SAME: baseType: ![[POD:[0-9]+]], offset: 4, flags: DIFlagVirtual, extraData: i32 0)
|
||||
|
||||
// CHECK: ![[POD]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "POD"
|
||||
|
||||
|
|
Loading…
Reference in New Issue