Always emit bitfield properties using expression behavior, even if they're

atomic.  This is probably something we should warn about.

llvm-svn: 139584
This commit is contained in:
John McCall 2011-09-13 05:36:29 +00:00
parent f9f68b816b
commit 0e5c086de4
2 changed files with 16 additions and 0 deletions

View File

@ -495,6 +495,13 @@ PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM,
return;
}
// Properties on bitfield ivars need to be emitted using expression
// accesses even if they're nominally atomic.
if (ivar->isBitField()) {
Kind = Expression;
return;
}
// GC-qualified or ARC-qualified ivars need to be emitted as
// expressions. This actually works out to being atomic anyway,
// except for ARC __strong, but that should trigger the above code.

View File

@ -103,3 +103,12 @@ void test4(Test4 *t) {
// CHECK-NEXT: ret void
test4_printf("%.2f", t.f);
}
@interface Test5 {
unsigned _x : 5;
}
@property unsigned x;
@end
@implementation Test5
@synthesize x = _x;
@end