DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren't needlessly built during -gmlt

llvm-svn: 202900
This commit is contained in:
David Blaikie 2014-03-04 22:01:08 +00:00
parent 9bbf3cd3d7
commit 0856f66dd2

View File

@ -1435,6 +1435,9 @@ void CGDebugInfo::completeType(const RecordDecl *RD) {
}
void CGDebugInfo::completeRequiredType(const RecordDecl *RD) {
if (DebugKind <= CodeGenOptions::DebugLineTablesOnly)
return;
if (const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD))
if (CXXDecl->isDynamicClass())
return;
@ -2042,6 +2045,9 @@ llvm::DIType CGDebugInfo::getCompletedTypeOrNull(QualType Ty) {
void CGDebugInfo::completeTemplateDefinition(
const ClassTemplateSpecializationDecl &SD) {
if (DebugKind <= CodeGenOptions::DebugLineTablesOnly)
return;
completeClassData(&SD);
// In case this type has no member function definitions being emitted, ensure
// it is retained
@ -3341,8 +3347,7 @@ void CGDebugInfo::finalize() {
// up the final type in the type cache.
for (std::vector<void *>::const_iterator RI = RetainedTypes.begin(),
RE = RetainedTypes.end(); RI != RE; ++RI)
if (llvm::Value *V = TypeCache[*RI])
DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(V)));
DBuilder.retainType(llvm::DIType(cast<llvm::MDNode>(TypeCache[*RI])));
DBuilder.finalize();
}