summaryrefslogtreecommitdiffstats
path: root/clang/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
commitd9a909cd29cf33dd6a8819c6c9b42fff5b5a79e8 (patch)
tree4cecc364a794ac2adf3916a0512615671ec035a9 /clang/lib/AST/RecordLayoutBuilder.cpp
parent8b0a57506581be80af23ec7f134089eb4db9ffc9 (diff)
downloadbcm5719-llvm-d9a909cd29cf33dd6a8819c6c9b42fff5b5a79e8.tar.gz
bcm5719-llvm-d9a909cd29cf33dd6a8819c6c9b42fff5b5a79e8.zip
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
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
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<ObjCInterfaceDecl*>(D));
D = D->getDefinition();
assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");
OpenPOWER on IntegriCloud