ObjC getters with names like "newItem" should still be linked to the @property.
Two years ago I added a compile-time "optimization" to ObjCMethodDecl::findPropertyDecl: exit early if the current method is part of a special Objective-C method family (like 'new' or 'init'). However, if a property (declared with @property) has a name that matches a method family, the getter picks up that family despite being declared by the property. The early exit then made ObjCMethodDecl::findPropertyDecl decide that there was no associated property, despite the method itself being marked as an accessor. This corrects that by removing the early exit. This does /not/ change the fact that such a getter is considered to return a value with a +1 retain count. The best way to eliminate this is by adding the objc_method_family(none) attribute to the getter, but unlike the existing ns_returns_not_retained that can't be applied directly to the property -- you have to redeclare the getter instead. (It'd be nice if @property just implied objc_method_family(none) for its getter, but that would be a backwards-incompatible change.) rdar://problem/19038838 llvm-svn: 226338
Loading
Please register or sign in to comment