summaryrefslogtreecommitdiffstats
path: root/clang/docs/AutomaticReferenceCounting.html
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-08-20 23:36:59 +0000
committerJohn McCall <rjmccall@apple.com>2012-08-20 23:36:59 +0000
commitd8561f058d8c3497dd7a98dbffcd30b0d4be22b0 (patch)
tree925017d0a36bc904ebda2d8464c26e1e2bb5395a /clang/docs/AutomaticReferenceCounting.html
parent4a903df403f360482068b05cb20b6ef47b7d68eb (diff)
downloadbcm5719-llvm-d8561f058d8c3497dd7a98dbffcd30b0d4be22b0.tar.gz
bcm5719-llvm-d8561f058d8c3497dd7a98dbffcd30b0d4be22b0.zip
Fix a pair of bugs relating to properties in ARC.
First, when synthesizing an explicitly strong/retain/copy property of Class type, don't pretend during compatibility checking that the property is actually assign. Instead, resolve incompatibilities by secretly changing the type of *implicitly* __unsafe_unretained Class ivars to be strong. This is moderately evil but better than what we were doing. Second, when synthesizing the setter for a strong property of non-retainable type, be sure to use objc_setProperty. This is possible when the property is decorated with the NSObject attribute. This is an ugly, ugly corner of the language, and we probably ought to deprecate it. The first is rdar://problem/12039404; the second was noticed by inspection while fixing the first. llvm-svn: 162244
Diffstat (limited to 'clang/docs/AutomaticReferenceCounting.html')
-rw-r--r--clang/docs/AutomaticReferenceCounting.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/docs/AutomaticReferenceCounting.html b/clang/docs/AutomaticReferenceCounting.html
index 3f1ccaf672c..2fd82dda65c 100644
--- a/clang/docs/AutomaticReferenceCounting.html
+++ b/clang/docs/AutomaticReferenceCounting.html
@@ -888,6 +888,15 @@ from non-ARC practice was acceptable because we had conservatively
banned the synthesis in order to give ourselves exactly this
leeway.</p></div>
+<p>Applying <tt>__attribute__((NSObject))</tt> to a property not of
+retainable object pointer type has the same behavior it does outside
+of ARC: it requires the property type to be some sort of pointer and
+permits the use of modifiers other than <tt>assign</tt>. These
+modifiers only affect the synthesized getter and setter; direct
+accesses to the ivar (even if synthesized) still have primitive
+semantics, and the value in the ivar will not be automatically
+released during deallocation.</p>
+
</div> <!-- ownership.spelling.property -->
</div> <!-- ownership.spelling -->
OpenPOWER on IntegriCloud