summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/arc-property.m
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen][ObjC] Annotate calls to objc_retainAutoreleasedReturnValueAkira Hatanaka2019-03-211-1/+1
| | | | | | | | | | | | | with notail on x86-64. On x86-64, the epilogue code inserted before the tail jump blocks the autoreleased return optimization. rdar://problem/38675807 Differential Revision: https://reviews.llvm.org/D59656 llvm-svn: 356705
* Generate objc intrinsics instead of runtime calls as the ARC optimizer now ↵Pete Cooper2018-12-181-10/+10
| | | | | | | | | works only on intrinsics Differential Revision: https://reviews.llvm.org/D55802 Reviewers: rjmccall llvm-svn: 349535
* [ObjC] Pick a 'readwrite' property when synthesizing ambiguousAlex Lorenz2017-07-131-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | property and check for incompatible attributes This commit changes the way ambiguous property synthesis (i.e. when synthesizing a property that's declared in multiple protocols) is performed. Previously, Clang synthesized the first property that was found. This lead to problems when the property was synthesized in a class that conformed to two protocols that declared that property and a second protocols had a 'readwrite' declaration - the setter was not synthesized so the class didn't really conform to the second protocol and user's code would crash at runtime when they would try to set the property. This commit ensures that a first readwrite property is selected. This is a semantic change that changes users code in this manner: ``` @protocol P @property(readonly) int p; @end @protocol P2 @property(readwrite) id p; @end @interface I <P2> @end @implementation I @syntesize p; // Users previously got a warning here, and Clang synthesized // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p.. @end ``` To ensure that this change is safe, the warning about incompatible types is promoted to an error when this kind of readonly/readwrite ambiguity is detected in the @implementation. This will ensure that previous code that had this subtle bug and ignored the warning now will fail to compile with an error, and users should not get suprises at runtime once they resolve the error. The commit also extends the ambiguity checker, and now it can detect conflicts among the different property attributes. An error diagnostic is used for conflicting attributes, to ensure that the user won't get "suprises" at runtime. ProtocolPropertyMap is removed in favour of a a set + vector because the map's order of iteration is non-deterministic, so it couldn't be used to select the readwrite property. rdar://31579994 Differential Revision: https://reviews.llvm.org/D35268 llvm-svn: 307903
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-17/+17
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-3/+3
| | | | llvm-svn: 230783
* Don't manually insert L prefixes.Rafael Espindola2014-11-061-2/+2
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* Objective-C [IRGen]. Generator a tail call to objc_getProperty() in Fariborz Jahanian2014-01-301-1/+1
| | | | | | | synthesized getters for performance improvement. // rdar://15884113 llvm-svn: 200430
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-1/+1
| | | | | | tests fail. llvm-svn: 188447
* Be sure to check ARC conventions on the implicit method declarationsJohn McCall2013-04-041-0/+45
| | | | | | | | | of a property just in case the property's getter happens to be +1. We won't synthesize a getter for such a property, but we will allow the user to define a +1 method for it. rdar://13115896 llvm-svn: 178731
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-2/+4
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* objective-C arc IR-gen. Retaining of strongFariborz Jahanian2013-02-211-2/+2
| | | | | | | | | | arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 llvm-svn: 175698
* At -O0, prefer objc_storeStrong with a null new value to theJohn McCall2012-10-171-2/+2
| | | | | | | | | | | combination of a load+objc_release; this is generally better for tools that try to track why values are retained and released. Also use objc_storeStrong when copying a block (again, only at -O0), which requires us to do a preliminary store of null in order to compensate for objc_storeStrong's assign semantics. llvm-svn: 166085
* Fix a pair of bugs relating to properties in ARC.John McCall2012-08-201-0/+72
| | | | | | | | | | | | | | | | | | | | 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
* Strip qualifiers off the type of an implicit property defined byJohn McCall2011-10-171-0/+15
only a setter. llvm-svn: 142236
OpenPOWER on IntegriCloud