diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-08-22 15:23:05 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-08-22 15:23:05 +0000 |
commit | d89b99d421a95c1e4adb009ea2ef2ee81cfd61b2 (patch) | |
tree | 0cc98c5a229d391df8aaa3a95679371edd9124a0 /clang/lib/CodeGen/CGVTables.cpp | |
parent | 7b5d4f97a0ffe1f8ef37571d03fd9120f39529fb (diff) | |
download | llvm-d89b99d421a95c1e4adb009ea2ef2ee81cfd61b2.zip llvm-d89b99d421a95c1e4adb009ea2ef2ee81cfd61b2.tar.gz llvm-d89b99d421a95c1e4adb009ea2ef2ee81cfd61b2.tar.bz2 |
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.
llvm-svn: 189022
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGVTables.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index 6649578..848fbbb 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/lib/CodeGen/CGVTables.cpp @@ -685,6 +685,9 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, 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 CodeGenModule::EmitVTable(CXXRecordDecl *theClass, bool isRequired) { 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); |