]> granicus.if.org Git - clang/commitdiff
Module debugging: Add an assertion.
authorAdrian Prantl <aprantl@apple.com>
Tue, 26 Apr 2016 23:42:43 +0000 (23:42 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 26 Apr 2016 23:42:43 +0000 (23:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267633 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index e794aeeb169bbf58c1750022bfef9ece994235c1..b44ddc4d1878d8d90ab5ed1c8d60a639ce4ebb1e 100644 (file)
@@ -1520,11 +1520,13 @@ static bool isDefinedInClangModule(const RecordDecl *RD) {
     return false;
   if (!RD->isExternallyVisible() && RD->getName().empty())
     return false;
-  if (auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD))
+  if (auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD)) {
+    assert(CXXDecl->isCompleteDefinition() && "incomplete record definition");
     if (CXXDecl->getTemplateSpecializationKind() != TSK_Undeclared)
       // Make sure the instantiation is actually in a module.
       if (CXXDecl->field_begin() != CXXDecl->field_end())
         return CXXDecl->field_begin()->isFromASTFile();
+  }
 
   return true;
 }