diff options
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 71377224461..c2878c38f6e 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1648,9 +1648,13 @@ void CGDebugInfo::completeRequiredType(const RecordDecl *RD) { if (DebugKind <= codegenoptions::DebugLineTablesOnly) return; - if (const auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) - if (CXXDecl->isDynamicClass()) - return; + // If this is a dynamic class and we're emitting limited debug info, wait + // until the vtable is emitted to complete the class debug info. + if (DebugKind <= codegenoptions::LimitedDebugInfo) { + if (const auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) + if (CXXDecl->isDynamicClass()) + return; + } if (DebugTypeExtRefs && RD->isFromASTFile()) return; |