[cfe-commits] r113454 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/block-var-layout.m
Fariborz Jahanian
fjahanian at apple.com
Wed Sep 8 17:21:45 PDT 2010
Author: fjahanian
Date: Wed Sep 8 19:21:45 2010
New Revision: 113454
URL: http://llvm.org/viewvc/llvm-project?rev=113454&view=rev
Log:
Block ivar layout must assume that the 'isa'
field of the block descriptor is GC'able (scanned)
as this what the runtime expects (one can send it
messages). Radar 8394947.
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/test/CodeGenObjC/block-var-layout.m
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=113454&r1=113453&r2=113454&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Sep 8 19:21:45 2010
@@ -1675,6 +1675,9 @@
unsigned WordSizeInBits = CGM.getContext().Target.getPointerWidth(0);
unsigned ByteSizeInBits = CGM.getContext().Target.getCharWidth();
+ // __isa is the first field in block descriptor and must assume by runtime's
+ // convention that it is GC'able.
+ IvarsInfo.push_back(GC_IVAR(0, 1));
for (size_t i = 0; i < DeclRefs.size(); ++i) {
const BlockDeclRefExpr *BDRE = DeclRefs[i];
const ValueDecl *VD = BDRE->getDecl();
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=113454&r1=113453&r2=113454&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/block-var-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/block-var-layout.m Wed Sep 8 19:21:45 2010
@@ -108,16 +108,16 @@
}
// CHECK-LP64: L_OBJC_CLASS_NAME_:
-// CHECK-LP64-NEXT: .asciz "A\024"
+// CHECK-LP64-NEXT: .asciz "\0011\024"
// CHECK-LP64: L_OBJC_CLASS_NAME_1:
-// CHECK-LP64-NEXT: .asciz "A\025"
+// CHECK-LP64-NEXT: .asciz "\0011\025"
// CHECK-LP64: L_OBJC_CLASS_NAME_6:
-// CHECK-LP64-NEXT: .asciz "A\023!"
+// CHECK-LP64-NEXT: .asciz "\0011\023!"
// CHECK-LP64: L_OBJC_CLASS_NAME_11:
-// CHECK-LP64-NEXT: .asciz "Q\021\021"
+// CHECK-LP64-NEXT: .asciz "\001A\021\021"
// CHECK-LP64: L_OBJC_CLASS_NAME_14:
-// CHECK-LP64-NEXT: .asciz "Q\021\022p"
+// CHECK-LP64-NEXT: .asciz "\001A\021\022p"
More information about the cfe-commits
mailing list