forked from OSchip/llvm-project
DebugInfo: Prefer vtable homing over ctor homing.
Vtables will be emitted in fewer places than ctors (every ctor references the vtable, so at worst it's the same places - but at best the type has a non-inline key function and the vtable is emitted in one place) Pulling this fix out of517bbc64db
which was reverted in4821508d4d
This commit is contained in:
parent
06da353748
commit
4e719e0f16
|
@ -3351,7 +3351,7 @@ void CGDebugInfo::completeTemplateDefinition(
|
|||
}
|
||||
|
||||
void CGDebugInfo::completeUnusedClass(const CXXRecordDecl &D) {
|
||||
if (DebugKind <= codegenoptions::DebugLineTablesOnly)
|
||||
if (DebugKind <= codegenoptions::DebugLineTablesOnly || D.isDynamicClass())
|
||||
return;
|
||||
|
||||
completeClassData(&D);
|
||||
|
|
|
@ -77,3 +77,14 @@ void L() {
|
|||
// Check that types are being added to retained types list.
|
||||
// CHECK-DAG: !DICompileUnit{{.*}}retainedTypes: ![[RETAINED:[0-9]+]]
|
||||
// CHECK-DAG: ![[RETAINED]] = {{.*}}![[C]]
|
||||
|
||||
|
||||
struct VTableAndCtor {
|
||||
virtual void f1();
|
||||
VTableAndCtor();
|
||||
};
|
||||
|
||||
VTableAndCtor::VTableAndCtor() {
|
||||
}
|
||||
|
||||
// CHECK-DAG: !DICompositeType({{.*}}name: "VTableAndCtor", {{.*}}flags: DIFlagFwdDecl
|
||||
|
|
Loading…
Reference in New Issue