aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/RecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-03-15 16:33:08 +0000
committerSean Callanan <scallanan@apple.com>2012-03-15 16:33:08 +0000
commitcad313bd7b28674e0e409e610c450a2411107443 (patch)
treecb0de7cd4e417b702de55d9bc27e1db662b0a6a8 /lib/AST/RecordLayoutBuilder.cpp
parent684944e53c926c3b32b9d5fa507ba4c26398a3ae (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index f73287503e..c2d9294a00 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/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<ObjCInterfaceDecl*>(D));
D = D->getDefinition();
assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");