diff options
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenObjC/block-var-layout.m | 6 | ||||
-rw-r--r-- | test/CodeGenObjCXX/block-var-layout.mm | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 281bb7e1db..9d06fbdbc1 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/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/test/CodeGenObjC/block-var-layout.m b/test/CodeGenObjC/block-var-layout.m index c8065be88c..71b14dab24 100644 --- a/test/CodeGenObjC/block-var-layout.m +++ b/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/test/CodeGenObjCXX/block-var-layout.mm b/test/CodeGenObjCXX/block-var-layout.mm index 00dd2c00ef..f8b6b9c886 100644 --- a/test/CodeGenObjCXX/block-var-layout.mm +++ b/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); |