From b201e4d6aba8c71777c2d48e3f9ee791df9a0de6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 6 Nov 2012 03:38:02 +0000 Subject: [PATCH] Minor fix to ObjC layout bitmap metadata. Found while I was trying to refactor the code. llvm-svn: 167436 --- clang/lib/CodeGen/CGObjCMac.cpp | 2 +- clang/test/CodeGenObjC/block-var-layout.m | 6 +++--- clang/test/CodeGenObjCXX/block-var-layout.mm | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 281bb7e..9d06fbd 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -4534,7 +4534,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI, if (IsUnion) { // FIXME: Why the asymmetry? We divide by word size in bits on other // side. - uint64_t UnionIvarSize = FieldSize; + uint64_t UnionIvarSize = FieldSize / ByteSizeInBits; if (UnionIvarSize > MaxSkippedUnionIvarSize) { MaxSkippedUnionIvarSize = UnionIvarSize; MaxSkippedField = Field; diff --git a/clang/test/CodeGenObjC/block-var-layout.m b/clang/test/CodeGenObjC/block-var-layout.m index c8065be..71b14da 100644 --- a/clang/test/CodeGenObjC/block-var-layout.m +++ b/clang/test/CodeGenObjC/block-var-layout.m @@ -90,7 +90,7 @@ void f() { // Test 4 // struct S (int, id, int, id, int, id) -// 01 41 11 11 +// 01 41 11 11 00 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\01A\11\11\00" struct S s2; void (^e)() = ^{ @@ -128,8 +128,8 @@ void Test5() { union U u2; // struct s2 (int, id, int, id, int, id?), union u2 (id?) -// 01 41 11 12 70 00 -// CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [6 x i8] c"\01A\11\12p\00" +// 01 41 11 12 00 +// CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\01A\11\12\00" void (^c)() = ^{ x(s2.ui.o1); x(u2.o1); diff --git a/clang/test/CodeGenObjCXX/block-var-layout.mm b/clang/test/CodeGenObjCXX/block-var-layout.mm index 00dd2c0..f8b6b9c 100644 --- a/clang/test/CodeGenObjCXX/block-var-layout.mm +++ b/clang/test/CodeGenObjCXX/block-var-layout.mm @@ -80,7 +80,7 @@ void (^d)() = ^{ // Test4 // struct S (int, id, int, id, int, id) -// 01 41 11 11 +// 01 41 11 11 00 // CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\01A\11\11\00" struct S s2; void (^e)() = ^{ @@ -118,8 +118,8 @@ void Test5() { union U u2; // struct s2 (int, id, int, id, int, id?), union u2 (id?) -// 01 41 11 12 70 00 -// CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [6 x i8] c"\01A\11\12p\00" +// 01 41 11 12 00 +// CHECK-LP64: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [5 x i8] c"\01A\11\12\00" void (^c)() = ^{ x(s2.ui.o1); x(u2.o1); -- 2.7.4