[cfe-commits] r152807 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Sean Callanan scallanan at apple.com
Thu Mar 15 09:33:09 PDT 2012


Author: spyffe
Date: Thu Mar 15 11:33:08 2012
New Revision: 152807

URL: http://llvm.org/viewvc/llvm-project?rev=152807&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=152807&r1=152806&r2=152807&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Thu Mar 15 11:33:08 2012
@@ -2313,6 +2313,8 @@
 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!");
 





More information about the cfe-commits mailing list