summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-13 05:36:29 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-13 05:36:29 +0000
commit0e5c086de48ecd668525d8f23f123340adb160b5 (patch)
tree33f0b81f91187f2fd41ad550dbbb7c004ef7c7a2
parentf9f68b816ba63da0504e1cf63f2a1be4168cdb3d (diff)
downloadbcm5719-llvm-0e5c086de48ecd668525d8f23f123340adb160b5.tar.gz
bcm5719-llvm-0e5c086de48ecd668525d8f23f123340adb160b5.zip
Always emit bitfield properties using expression behavior, even if they're
atomic. This is probably something we should warn about. llvm-svn: 139584
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp7
-rw-r--r--clang/test/CodeGenObjC/property.m9
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 888f67d6618..f0a47af909e 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -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.
diff --git a/clang/test/CodeGenObjC/property.m b/clang/test/CodeGenObjC/property.m
index dd0786eb30e..3cc9200f333 100644
--- a/clang/test/CodeGenObjC/property.m
+++ b/clang/test/CodeGenObjC/property.m
@@ -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
OpenPOWER on IntegriCloud