diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-03 13:15:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-03 13:15:50 +0000 |
commit | 532d4daa038d972240138e2fd6e1122517340833 (patch) | |
tree | 63397aa3bf02b6edff3bad8947ded0f82ec611e5 /lib/AST/ASTContext.cpp | |
parent | 9f89f2bc111339ee7fa0df3c2f18e39493b460c4 (diff) |
Use ASTRecordLayout for computing ivar offsets instead of shadow
struct.
- We still need to do more lookup than necessary because ivars don't
live in a reasonable DeclContext.
- The only remaining client of the interface shadow struct is the
ivar layout bitmap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f58291ee21..ac70cef499 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -744,6 +744,8 @@ const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D) { const ASTRecordLayout & ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, const ObjCImplementationDecl *Impl) { + assert(!D->isForwardDecl() && "Invalid interface decl!"); + // Look up this layout, if already laid out, return what we have. ObjCContainerDecl *Key = Impl ? (ObjCContainerDecl*) Impl : (ObjCContainerDecl*) D; @@ -768,6 +770,9 @@ ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, ASTRecordLayout *NewEntry = NULL; if (ObjCInterfaceDecl *SD = D->getSuperClass()) { + // FIXME: This increment of FieldCount is wrong, we don't actually + // count the super class as a member (see the field index passed + // to LayoutField below). FieldCount++; const ASTRecordLayout &SL = getASTObjCInterfaceLayout(SD); unsigned Alignment = SL.getAlignment(); |