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.

llvm-svn: 113454
This commit is contained in:
Fariborz Jahanian 2010-09-09 00:21:45 +00:00
parent 3cf63f1edd
commit cfddabf5a3
2 changed files with 8 additions and 5 deletions

View File

@ -1675,6 +1675,9 @@ llvm::Constant *CGObjCCommonMac::GCBlockLayout(CodeGen::CodeGenFunction &CGF,
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();

View File

@ -108,16 +108,16 @@ c();
}
// 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"