MethToIvarMapTy PropGetterToIvarMap;
PropToIvarMapTy PropertyToIvarMap;
IvarToPropMapTy IvarToPopertyMap;
- for (ObjCInterfaceDecl::prop_iterator
- I = InterfaceD->prop_begin(),
- E = InterfaceD->prop_end(); I != E; ++I) {
- const ObjCPropertyDecl *PD = *I;
+
+ ObjCInterfaceDecl::PropertyMap PropMap;
+ InterfaceD->collectPropertiesToImplement(PropMap);
+
+ for (ObjCInterfaceDecl::PropertyMap::iterator
+ I = PropMap.begin(), E = PropMap.end(); I != E; ++I) {
+ const ObjCPropertyDecl *PD = I->second;
const ObjCIvarDecl *ID = findPropertyBackingIvar(PD, InterfaceD, Ivars);
if (!ID) {
const ObjCPropertyDecl *PD = IvarToPopertyMap[IvarDecl];
assert(PD &&
"Do we synthesize ivars for something other than properties?");
- os << "Property "<< PD->getName() << " needs to be invalidated";
+ os << "Property "<< PD->getName() <<
+ " needs to be invalidated or set to nil";
} else {
os << "Instance variable "<< IvarDecl->getName()
<< " needs to be invalidated or set to nil";
SomeInvalidationImplementingObject *_Prop3; // property, invalidate via sending a message to a getter method
SomeInvalidationImplementingObject *_Prop4; // property with @synthesize, invalidate via property
SomeInvalidationImplementingObject *_Prop5; // property with @synthesize, invalidate via getter method
+ SomeInvalidationImplementingObject *_Prop8;
// No warnings on these as they are not invalidatable.
NSObject *NIvar1;
@synthesize Prop3 = _Prop3;
@synthesize Prop5 = _Prop5;
@synthesize Prop4 = _Prop4;
+@synthesize Prop8 = _Prop8;
- (void) setProp1: (SomeInvalidationImplementingObject*) InObj {
[self setProp3:0];
[[self Prop5] invalidate2];
[self.Prop4 invalidate];
+ [self.Prop8 invalidate];
self.Prop6 = 0;
[[self Prop7] invalidate];
// expected-warning@-1 {{Instance variable Ivar1 needs to be invalidated}}
// expected-warning@-2 {{Instance variable MultipleProtocols needs to be invalidated}}
// expected-warning@-3 {{Instance variable MultInheritance needs to be invalidated}}
- // expected-warning@-4 {{Property SynthIvarProp needs to be invalidated}}
+ // expected-warning@-4 {{Property SynthIvarProp needs to be invalidated or set to nil}}
// expected-warning@-5 {{Instance variable _Ivar3 needs to be invalidated}}
// expected-warning@-6 {{Instance variable _Ivar4 needs to be invalidated}}
// expected-warning@-7 {{Instance variable Ivar5 needs to be invalidated or set to nil}}
- // expected-warning@-8 {{Property Prop8 needs to be invalidated}}
@end