From 82e0435b8b57a4b65df6d365cc8c5e12ba036a57 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267633 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index e794aeeb16..b44ddc4d18 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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.50.1