[cfe-commits] r139584 - in /cfe/trunk: lib/CodeGen/CGObjC.cpp test/CodeGenObjC/property.m
John McCall
rjmccall at apple.com
Mon Sep 12 22:36:29 PDT 2011
Author: rjmccall
Date: Tue Sep 13 00:36:29 2011
New Revision: 139584
URL: http://llvm.org/viewvc/llvm-project?rev=139584&view=rev
Log:
Always emit bitfield properties using expression behavior, even if they're
atomic. This is probably something we should warn about.
Modified:
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/test/CodeGenObjC/property.m
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=139584&r1=139583&r2=139584&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Tue Sep 13 00:36:29 2011
@@ -495,6 +495,13 @@
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.
Modified: cfe/trunk/test/CodeGenObjC/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property.m?rev=139584&r1=139583&r2=139584&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property.m (original)
+++ cfe/trunk/test/CodeGenObjC/property.m Tue Sep 13 00:36:29 2011
@@ -103,3 +103,12 @@
// CHECK-NEXT: ret void
test4_printf("%.2f", t.f);
}
+
+ at interface Test5 {
+ unsigned _x : 5;
+}
+ at property unsigned x;
+ at end
+ at implementation Test5
+ at synthesize x = _x;
+ at end
More information about the cfe-commits
mailing list