]> granicus.if.org Git - clang/commitdiff
DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 4 Mar 2014 22:01:08 +0000 (22:01 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 4 Mar 2014 22:01:08 +0000 (22:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202900 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index c91b7a97443033266883851c0cf9ee68d237f3bd..2ad750b46a7dab5de2493e0f83f7c14fd897210b 100644 (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();
 }