DebugInfo: emit the definition of types when construction vtables are required as these types may never end up emitting the full class data
This might be able to be optimized further by only doing this in the
absence of a key function, but it doesn't look like GCC is doing that so
I'm not rushing to do it just yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189022 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp
index 6649578..848fbbb 100644
--- a/lib/CodeGen/CGVTables.cpp
+++ b/lib/CodeGen/CGVTables.cpp
@@ -685,6 +685,9 @@
bool BaseIsVirtual,
llvm::GlobalVariable::LinkageTypes Linkage,
VTableAddressPointsMapTy& AddressPoints) {
+ if (CGDebugInfo *DI = CGM.getModuleDebugInfo())
+ DI->completeClassData(Base.getBase());
+
OwningPtr<VTableLayout> VTLayout(
VTContext.createConstructionVTableLayout(Base.getBase(),
Base.getBaseOffset(),
@@ -822,15 +825,15 @@
void
CodeGenVTables::GenerateClassData(const CXXRecordDecl *RD) {
+ if (CGDebugInfo *DI = CGM.getModuleDebugInfo())
+ DI->completeClassData(RD);
+
if (VFTContext.isValid()) {
// FIXME: This is a temporary solution to force generation of vftables in
// Microsoft ABI. Remove when we thread VFTableContext through CodeGen.
VFTContext->getVFPtrOffsets(RD);
}
- if (CGDebugInfo *DI = CGM.getModuleDebugInfo())
- DI->completeClassData(RD);
-
// First off, check whether we've already emitted the v-table and
// associated stuff.
llvm::GlobalVariable *VTable = GetAddrOfVTable(RD);