summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-20 15:50:13 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-20 15:50:13 +0000
commit64d9257e38a08bc836508a4159723bc1e39194ad (patch)
tree23303a85a04123004ca3614e63cc57cf94cd085b /clang/lib/AST/RecordLayoutBuilder.cpp
parentec7e6e09463a932bf01d64241888df85e692e665 (diff)
downloadbcm5719-llvm-64d9257e38a08bc836508a4159723bc1e39194ad.tar.gz
bcm5719-llvm-64d9257e38a08bc836508a4159723bc1e39194ad.zip
When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>. llvm-svn: 146976
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index a47bd4afb43..43dee104ba3 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -2161,7 +2161,9 @@ const CXXMethodDecl *ASTContext::getKeyFunction(const CXXRecordDecl *RD) {
const ASTRecordLayout &
ASTContext::getObjCLayout(const ObjCInterfaceDecl *D,
const ObjCImplementationDecl *Impl) const {
- assert(D->isThisDeclarationADefinition() && "Invalid interface decl!");
+ // Retrieve the definition
+ D = D->getDefinition();
+ assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");
// Look up this layout, if already laid out, return what we have.
ObjCContainerDecl *Key =
OpenPOWER on IntegriCloud