r202900 - DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren't needlessly built during -gmlt
David Blaikie
dblaikie at gmail.com
Tue Mar 4 14:01:08 PST 2014
Author: dblaikie
Date: Tue Mar 4 16:01:08 2014
New Revision: 202900
URL: http://llvm.org/viewvc/llvm-project?rev=202900&view=rev
Log:
DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren't needlessly built during -gmlt
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=202900&r1=202899&r2=202900&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Mar 4 16:01:08 2014
@@ -1435,6 +1435,9 @@ void CGDebugInfo::completeType(const Rec
}
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::getCompletedTy
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();
}
More information about the cfe-commits
mailing list