From 9491371f6ff345a820ff98e398b194604fd341dc Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 26 Apr 2016 23:42:43 +0000 Subject: [PATCH] Module debugging: Add an assertion. llvm-svn: 267633 --- clang/lib/CodeGen/CGDebugInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index e794aee..b44ddc4 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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(RD)) + if (auto *CXXDecl = dyn_cast(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; } -- 2.7.4