From 49655e6ef1ea004d0fb33f7f11f97f4bcdc30ef6 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 4 Mar 2014 22:01:08 +0000 Subject: [PATCH] DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren't needlessly built during -gmlt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202900 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index c91b7a9744..2ad750b46a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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(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::const_iterator RI = RetainedTypes.begin(), RE = RetainedTypes.end(); RI != RE; ++RI) - if (llvm::Value *V = TypeCache[*RI]) - DBuilder.retainType(llvm::DIType(cast(V))); + DBuilder.retainType(llvm::DIType(cast(TypeCache[*RI]))); DBuilder.finalize(); } -- 2.40.0