From d9a909cd29cf33dd6a8819c6c9b42fff5b5a79e8 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Thu, 15 Mar 2012 16:33:08 +0000 Subject: When laying out an Objective-C object, consult the external source to complete the Decl if it hasn't been completed already. This fixes a crash in LLDB. llvm-svn: 152807 --- clang/lib/AST/RecordLayoutBuilder.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp') diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index f73287503ef..c2d9294a007 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -2313,6 +2313,8 @@ const ASTRecordLayout & ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, const ObjCImplementationDecl *Impl) const { // Retrieve the definition + if (D->hasExternalLexicalStorage() && !D->getDefinition()) + getExternalSource()->CompleteType(const_cast(D)); D = D->getDefinition(); assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!"); -- cgit v1.2.3