[cfe-commits] r167436 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/block-var-layout.m test/CodeGenObjCXX/block-var-layout.mm

Eli Friedman eli.friedman at gmail.com
Mon Nov 5 19:38:02 PST 2012


Author: efriedma
Date: Mon Nov  5 21:38:02 2012
New Revision: 167436

URL: http://llvm.org/viewvc/llvm-project?rev=167436&view=rev
Log:
Minor fix to ObjC layout bitmap metadata.  Found while I was trying to
refactor the code.


Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp
    cfe/trunk/test/CodeGenObjC/block-var-layout.m
    cfe/trunk/test/CodeGenObjCXX/block-var-layout.mm

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=167436&r1=167435&r2=167436&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Nov  5 21:38:02 2012
@@ -4534,7 +4534,7 @@
       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;

Modified: cfe/trunk/test/CodeGenObjC/block-var-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/block-var-layout.m?rev=167436&r1=167435&r2=167436&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/block-var-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/block-var-layout.m Mon Nov  5 21:38:02 2012
@@ -90,7 +90,7 @@
 
 // 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 @@
   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);

Modified: cfe/trunk/test/CodeGenObjCXX/block-var-layout.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/block-var-layout.mm?rev=167436&r1=167435&r2=167436&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/block-var-layout.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/block-var-layout.mm Mon Nov  5 21:38:02 2012
@@ -80,7 +80,7 @@
 
 // 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 @@
   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);





More information about the cfe-commits mailing list