summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-04 23:23:09 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-04 23:23:09 +0000
commit9b042e06eee378637958a68eb0abbad301c376c8 (patch)
tree700ea255ee5aa9cefb3977efba63a48211421274 /clang/lib/AST
parentdbfb1025239a2be51ac767cb3ef9b9d8d251c69d (diff)
downloadbcm5719-llvm-9b042e06eee378637958a68eb0abbad301c376c8.tar.gz
bcm5719-llvm-9b042e06eee378637958a68eb0abbad301c376c8.zip
Fix the field count in interface record layout (it was incorrectly
compensating for super classes). This was making the reported class sizes for empty classes very, very wrong. - Also, we now report the size info for an empty class like gcc (as the offset of the start, not as 0, 0). - Add a few more test cases we were mishandling before (padding bit field at end of struct, for example). llvm-svn: 70938
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTContext.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index a9f13c95180..a947fea95aa 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -713,10 +713,6 @@ 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();
uint64_t Size = SL.getSize();
@@ -729,8 +725,6 @@ ASTContext::getObjCLayout(const ObjCInterfaceDecl *D,
ObjCLayouts[Key] = NewEntry = new ASTRecordLayout(Size, Alignment);
NewEntry->InitializeLayout(FieldCount);
- // Super class is at the beginning of the layout.
- NewEntry->SetFieldOffset(0, 0);
} else {
ObjCLayouts[Key] = NewEntry = new ASTRecordLayout();
NewEntry->InitializeLayout(FieldCount);
OpenPOWER on IntegriCloud