summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-03 13:15:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-03 13:15:50 +0000
commit80b4eef6861ed5ec882b93aca341d3ab02a3e88a (patch)
tree7660fce98c56061a8e68e3878d9c376a08bd86d6 /clang/lib/AST
parente31559576f708e329d4b91e07a42645ac23ae10d (diff)
downloadbcm5719-llvm-80b4eef6861ed5ec882b93aca341d3ab02a3e88a.tar.gz
bcm5719-llvm-80b4eef6861ed5ec882b93aca341d3ab02a3e88a.zip
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. llvm-svn: 70756
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index f58291ee216..ac70cef499b 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud