]> granicus.if.org Git - clang/commitdiff
When laying out an Objective-C object, consult
authorSean Callanan <scallanan@apple.com>
Thu, 15 Mar 2012 16:33:08 +0000 (16:33 +0000)
committerSean Callanan <scallanan@apple.com>
Thu, 15 Mar 2012 16:33:08 +0000 (16:33 +0000)
the external source to complete the Decl if it
hasn't been completed already.

This fixes a crash in LLDB.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152807 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RecordLayoutBuilder.cpp

index f73287503efcaf5b900ded14d0e2b32b5288ba3d..c2d9294a007ef5101a2f2b4a7484df30fecda49b 100644 (file)
@@ -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<ObjCInterfaceDecl*>(D));
   D = D->getDefinition();
   assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");