Lines Matching full:property
1 //===--- SemaObjCProperty.cpp - Semantic Analysis for ObjC @property ------===//
9 // This file implements semantic analysis for Objective C @property and
33 /// getImpliedARCOwnership - Given a set of property attributes and a
54 // property type. in getImpliedARCOwnership()
63 /// Check the internal consistency of a property declaration with
66 ObjCPropertyDecl *property) { in checkPropertyDeclWithOwnership() argument
67 if (property->isInvalidDecl()) return; in checkPropertyDeclWithOwnership()
69 ObjCPropertyAttribute::Kind propertyKind = property->getPropertyAttributes(); in checkPropertyDeclWithOwnership()
71 = property->getType().getObjCLifetime(); in checkPropertyDeclWithOwnership()
76 = getImpliedARCOwnership(propertyKind, property->getType()); in checkPropertyDeclWithOwnership()
78 // We have a lifetime qualifier but no dominating property in checkPropertyDeclWithOwnership()
80 // setting the property attribute according to the lifetime in checkPropertyDeclWithOwnership()
91 property->setPropertyAttributes(attr); in checkPropertyDeclWithOwnership()
97 property->setInvalidDecl(); in checkPropertyDeclWithOwnership()
98 S.Diag(property->getLocation(), in checkPropertyDeclWithOwnership()
100 << property->getDeclName() in checkPropertyDeclWithOwnership()
105 /// Check this Objective-C property against a property declared in the
115 // Look for a property with the same name. in CheckPropertyAgainstProtocol()
123 // Check this property against any protocols we inherit. in CheckPropertyAgainstProtocol()
219 // Validate the attributes on the @property. in ActOnProperty()
230 // For a class, compare the property against a property in our superclass. in ActOnProperty()
244 // Also compare the property against a property in our protocols. in ActOnProperty()
257 // when property in class extension is constructed. in ActOnProperty()
347 // Determine whether the given property is readonly and implicitly in checkAtomicPropertyMismatch()
349 auto isImplicitlyReadonlyAtomic = [](ObjCPropertyDecl *Property) -> bool { in checkAtomicPropertyMismatch() argument
351 auto Attrs = Property->getPropertyAttributes(); in checkAtomicPropertyMismatch()
360 if (Property->getPropertyAttributesAsWritten() & in checkAtomicPropertyMismatch()
367 // If we're allowed to propagate atomicity, and the new property did in checkAtomicPropertyMismatch()
384 // One of the properties is atomic; if it's a readonly property, and in checkAtomicPropertyMismatch()
411 // Diagnose if this property is already in continuation class. in HandlePropertyInClassExtension()
416 // We need to look in the @interface to see if the @property was in HandlePropertyInClassExtension()
427 // Find the property in the extended class's primary class or in HandlePropertyInClassExtension()
432 // If we found a property in an extension, complain. in HandlePropertyInClassExtension()
441 // A readonly property declared in the primary class can be refined in HandlePropertyInClassExtension()
442 // by adding a readwrite property within an extension. in HandlePropertyInClassExtension()
446 // property is declared both in the @interface and the continuation. in HandlePropertyInClassExtension()
486 // Take the ownership from the original property. in HandlePropertyInClassExtension()
490 // If the redeclaration is 'weak' but the original property is not, in HandlePropertyInClassExtension()
510 // If there was no declaration of a property with the same name in in HandlePropertyInClassExtension()
520 // Relax the strict type matching for property type in continuation class. in HandlePropertyInClassExtension()
521 // Allow property object type of continuation class to be different as long in HandlePropertyInClassExtension()
522 // as it narrows the object type in its primary class property. Note that in HandlePropertyInClassExtension()
524 // property in primary class and 'narrowed' type for a 'readwrite' property in HandlePropertyInClassExtension()
541 // Check that atomicity of property in class extension matches the previous in HandlePropertyInClassExtension()
561 // Property defaults to 'assign' if it is readwrite, unless this is ARC in CreatePropertyDecl()
574 // Issue a warning if property is 'assign' as default and its in CreatePropertyDecl()
608 // Class property and instance property can have the same name. in CreatePropertyDecl()
707 ObjCPropertyDecl *property, in checkARCPropertyImpl() argument
709 if (property->isInvalidDecl() || ivar->isInvalidDecl()) return; in checkARCPropertyImpl()
714 // The lifetime implied by the property's attributes. in checkARCPropertyImpl()
716 getImpliedARCOwnership(property->getPropertyAttributes(), in checkARCPropertyImpl()
717 property->getType()); in checkARCPropertyImpl()
732 // property implementation before parsing any method bodies. in checkARCPropertyImpl()
749 << property->getDeclName() in checkARCPropertyImpl()
756 << property->getDeclName() in checkARCPropertyImpl()
762 << property->getDeclName() << ivar->getDeclName() in checkARCPropertyImpl()
763 << ((property->getPropertyAttributesAsWritten() & in checkARCPropertyImpl()
771 // Any other property should be ignored. in checkARCPropertyImpl()
775 S.Diag(property->getLocation(), diag::note_property_declare); in checkARCPropertyImpl()
782 /// property with no known lifetime of its own, using backing
783 /// 'ivar's attribute, if any. If no backing 'ivar', property's
786 ObjCPropertyDecl *property, ObjCIvarDecl *ivar) { in setImpliedPropertyAttributeForReadOnlyProperty() argument
788 getImpliedARCOwnership(property->getPropertyAttributes(), in setImpliedPropertyAttributeForReadOnlyProperty()
789 property->getType()); in setImpliedPropertyAttributeForReadOnlyProperty()
794 // if no backing ivar, make property 'strong'. in setImpliedPropertyAttributeForReadOnlyProperty()
795 property->setPropertyAttributes(ObjCPropertyAttribute::kind_strong); in setImpliedPropertyAttributeForReadOnlyProperty()
798 // property assumes owenership of backing ivar. in setImpliedPropertyAttributeForReadOnlyProperty()
802 property->setPropertyAttributes(ObjCPropertyAttribute::kind_strong); in setImpliedPropertyAttributeForReadOnlyProperty()
804 property->setPropertyAttributes(ObjCPropertyAttribute::kind_weak); in setImpliedPropertyAttributeForReadOnlyProperty()
818 /// property declaration that should be synthesised in all of the inherited
825 ObjCPropertyDecl *Property) { in SelectPropertyForSynthesisFromProtocols() argument
826 assert(isa<ObjCProtocolDecl>(Property->getDeclContext()) && in SelectPropertyForSynthesisFromProtocols()
827 "Expected a property from a protocol"); in SelectPropertyForSynthesisFromProtocols()
832 PDecl->collectInheritedProtocolProperties(Property, ProtocolSet, in SelectPropertyForSynthesisFromProtocols()
839 PDecl->collectInheritedProtocolProperties(Property, ProtocolSet, in SelectPropertyForSynthesisFromProtocols()
847 return Property; in SelectPropertyForSynthesisFromProtocols()
849 ObjCPropertyDecl *OriginalProperty = Property; in SelectPropertyForSynthesisFromProtocols()
852 // Select the 'readwrite' property if such property exists. in SelectPropertyForSynthesisFromProtocols()
853 if (Property->isReadOnly() && !Prop.value()->isReadOnly()) { in SelectPropertyForSynthesisFromProtocols()
854 Property = Prop.value(); in SelectPropertyForSynthesisFromProtocols()
858 if (Property != OriginalProperty) { in SelectPropertyForSynthesisFromProtocols()
859 // Check that the old property is compatible with the new one. in SelectPropertyForSynthesisFromProtocols()
863 QualType RHSType = S.Context.getCanonicalType(Property->getType()); in SelectPropertyForSynthesisFromProtocols()
864 unsigned OriginalAttributes = Property->getPropertyAttributesAsWritten(); in SelectPropertyForSynthesisFromProtocols()
872 // Represents a property from another protocol that conflicts with the in SelectPropertyForSynthesisFromProtocols()
881 // Verify the property attributes. in SelectPropertyForSynthesisFromProtocols()
889 // The ownership might be incompatible unless the property has no explicit in SelectPropertyForSynthesisFromProtocols()
919 if (Property->getGetterName() != Prop->getGetterName()) { in SelectPropertyForSynthesisFromProtocols()
923 if (!Property->isReadOnly() && !Prop->isReadOnly() && in SelectPropertyForSynthesisFromProtocols()
924 Property->getSetterName() != Prop->getSetterName()) { in SelectPropertyForSynthesisFromProtocols()
941 return Property; in SelectPropertyForSynthesisFromProtocols()
951 auto Diag = S.Diag(Property->getLocation(), in SelectPropertyForSynthesisFromProtocols()
952 Property != OriginalProperty || HasIncompatibleAttributes in SelectPropertyForSynthesisFromProtocols()
958 Diag << Property->getType(); in SelectPropertyForSynthesisFromProtocols()
965 Diag << Property->getGetterName(); in SelectPropertyForSynthesisFromProtocols()
968 Diag << Property->getSetterName(); in SelectPropertyForSynthesisFromProtocols()
995 return Property; in SelectPropertyForSynthesisFromProtocols()
998 /// Determine whether any storage attributes were written on the property.
1003 // If this is a readwrite property in a class extension that refines in hasWrittenStorageAttribute()
1004 // a readonly property in the original class definition, check it as in hasWrittenStorageAttribute()
1007 // If it's a readonly property, we're not interested. in hasWrittenStorageAttribute()
1014 // Find the corresponding property in the primary class definition. in hasWrittenStorageAttribute()
1031 /// Create a synthesized property accessor stub inside the \@implementation.
1059 /// builds the AST node for a property implementation declaration; declared
1069 // Make sure we have a context for the property implementation declaration. in ActOnPropertyImplDecl()
1079 ObjCPropertyDecl *property = nullptr; in ActOnPropertyImplDecl() local
1081 // Find the class or category class where this property must have in ActOnPropertyImplDecl()
1092 // Look for this property declaration in the @implementation's @interface in ActOnPropertyImplDecl()
1093 property = IDecl->FindPropertyDeclaration(PropertyId, QueryKind); in ActOnPropertyImplDecl()
1094 if (!property) { in ActOnPropertyImplDecl()
1098 if (property->isClassProperty() && Synthesize) { in ActOnPropertyImplDecl()
1102 unsigned PIkind = property->getPropertyAttributesAsWritten(); in ActOnPropertyImplDecl()
1109 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1113 dyn_cast<ObjCCategoryDecl>(property->getDeclContext())) { in ActOnPropertyImplDecl()
1116 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1121 property->hasAttr<IBOutletAttr>() && !AtLoc.isValid()) { in ActOnPropertyImplDecl()
1123 // Search into the class extensions and see if 'readonly property is in ActOnPropertyImplDecl()
1126 DeclContext::lookup_result R = Ext->lookup(property->getDeclName()); in ActOnPropertyImplDecl()
1137 Diag(property->getLocation(), diag::warn_auto_readonly_iboutlet_property) in ActOnPropertyImplDecl()
1138 << property; in ActOnPropertyImplDecl()
1141 property->getLParenLoc(), readonlyLoc)) { in ActOnPropertyImplDecl()
1145 Diag(property->getLocation(), in ActOnPropertyImplDecl()
1151 if (Synthesize && isa<ObjCProtocolDecl>(property->getDeclContext())) in ActOnPropertyImplDecl()
1152 property = SelectPropertyForSynthesisFromProtocols(SemaRef, AtLoc, IDecl, in ActOnPropertyImplDecl()
1153 property); in ActOnPropertyImplDecl()
1172 // Look for this property declaration in @implementation's category in ActOnPropertyImplDecl()
1173 property = Category->FindPropertyDeclaration(PropertyId, QueryKind); in ActOnPropertyImplDecl()
1174 if (!property) { in ActOnPropertyImplDecl()
1194 QualType PropType = property->getType(); in ActOnPropertyImplDecl()
1199 property->getDeclName())) { in ActOnPropertyImplDecl()
1200 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1205 (property->getPropertyAttributesAsWritten() & in ActOnPropertyImplDecl()
1208 setImpliedPropertyAttributeForReadOnlyProperty(property, Ivar); in ActOnPropertyImplDecl()
1211 ObjCPropertyAttribute::Kind kind = property->getPropertyAttributes(); in ActOnPropertyImplDecl()
1215 // Add GC __weak to the ivar type if the property is weak. in ActOnPropertyImplDecl()
1220 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1227 // the property type. in ActOnPropertyImplDecl()
1236 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1245 Diag(property->getLocation(), in ActOnPropertyImplDecl()
1257 // Check when default synthesizing a property that there is in ActOnPropertyImplDecl()
1258 // an ivar matching property name and issue warning; since this in ActOnPropertyImplDecl()
1260 // property in non-default synthesis case. in ActOnPropertyImplDecl()
1263 IDecl->lookupInstanceVariable(property->getIdentifier(), in ActOnPropertyImplDecl()
1270 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1277 // property attributes. in ActOnPropertyImplDecl()
1283 // explicitly write an ownership attribute on the property. in ActOnPropertyImplDecl()
1284 if (!hasWrittenStorageAttribute(property, QueryKind) && in ActOnPropertyImplDecl()
1288 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1292 assert(lifetime && "no lifetime for property?"); in ActOnPropertyImplDecl()
1308 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1329 // a property implementation and to avoid future warnings. in ActOnPropertyImplDecl()
1333 << property->getDeclName() << Ivar->getDeclName() in ActOnPropertyImplDecl()
1339 property->setPropertyIvarDecl(Ivar); in ActOnPropertyImplDecl()
1343 // Check that type of property and its ivar are type compatible. in ActOnPropertyImplDecl()
1357 << property->getDeclName() << PropType in ActOnPropertyImplDecl()
1361 // a property implementation and to avoid future warnings. in ActOnPropertyImplDecl()
1366 // specifically for property redeclarations as well as for ivars. in ActOnPropertyImplDecl()
1372 << property->getDeclName() << PropType in ActOnPropertyImplDecl()
1382 << property->getDeclName() << Ivar->getDeclName(); in ActOnPropertyImplDecl()
1387 if ((property->getType()->isObjCObjectPointerType() || in ActOnPropertyImplDecl()
1391 << property->getDeclName() << Ivar->getDeclName(); in ActOnPropertyImplDecl()
1397 checkARCPropertyImpl(SemaRef, PropertyLoc, property, Ivar); in ActOnPropertyImplDecl()
1402 assert (property && "ActOnPropertyImplDecl - property declaration missing"); in ActOnPropertyImplDecl()
1404 Context, SemaRef.CurContext, AtLoc, PropertyLoc, property, in ActOnPropertyImplDecl()
1412 if (ObjCMethodDecl *getterMethod = property->getGetterMethodDecl()) { in ActOnPropertyImplDecl()
1457 if (property->hasAttr<NSReturnsNotRetainedAttr>() && in ActOnPropertyImplDecl()
1461 Diag(property->getLocation(), diag::note_property_declare); in ActOnPropertyImplDecl()
1477 if (ObjCMethodDecl *setterMethod = property->getSetterMethodDecl()) { in ActOnPropertyImplDecl()
1516 if (property->getPropertyAttributes() & in ActOnPropertyImplDecl()
1523 if (property->getType()->isReferenceType()) { in ActOnPropertyImplDecl()
1526 << property->getType(); in ActOnPropertyImplDecl()
1556 // use and if 1) property is @dynamic or 2) property is synthesized in ActOnPropertyImplDecl()
1612 void SemaObjC::DiagnosePropertyMismatch(ObjCPropertyDecl *Property, in DiagnosePropertyMismatch() argument
1617 ObjCPropertyAttribute::Kind CAttr = Property->getPropertyAttributes(); in DiagnosePropertyMismatch()
1622 // to be overridden by a property with any explicit ownership in the subclass. in DiagnosePropertyMismatch()
1629 Diag(Property->getLocation(), diag::warn_readonly_property) in DiagnosePropertyMismatch()
1630 << Property->getDeclName() << inheritedName; in DiagnosePropertyMismatch()
1633 Diag(Property->getLocation(), diag::warn_property_attribute) in DiagnosePropertyMismatch()
1634 << Property->getDeclName() << "copy" << inheritedName; in DiagnosePropertyMismatch()
1643 Diag(Property->getLocation(), diag::warn_property_attribute) in DiagnosePropertyMismatch()
1644 << Property->getDeclName() << "retain (or strong)" << inheritedName; in DiagnosePropertyMismatch()
1650 // atomic property is 'readonly'. in DiagnosePropertyMismatch()
1651 checkAtomicPropertyMismatch(SemaRef, SuperProperty, Property, false); in DiagnosePropertyMismatch()
1654 if (Property->getSetterName() != SuperProperty->getSetterName() && in DiagnosePropertyMismatch()
1657 Diag(Property->getLocation(), diag::warn_property_attribute) in DiagnosePropertyMismatch()
1658 << Property->getDeclName() << "setter" << inheritedName; in DiagnosePropertyMismatch()
1661 if (Property->getGetterName() != SuperProperty->getGetterName()) { in DiagnosePropertyMismatch()
1662 Diag(Property->getLocation(), diag::warn_property_attribute) in DiagnosePropertyMismatch()
1663 << Property->getDeclName() << "getter" << inheritedName; in DiagnosePropertyMismatch()
1670 Context.getCanonicalType(Property->getType()); in DiagnosePropertyMismatch()
1674 // FIXME. For future support of covariant property types, revisit this. in DiagnosePropertyMismatch()
1680 Diag(Property->getLocation(), diag::warn_property_types_are_incompatible) in DiagnosePropertyMismatch()
1681 << Property->getType() << SuperProperty->getType() << inheritedName; in DiagnosePropertyMismatch()
1687 bool SemaObjC::DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *property, in DiagnosePropertyAccessorMismatch() argument
1695 property->getType().getNonReferenceType().getAtomicUnqualifiedType(); in DiagnosePropertyAccessorMismatch()
1707 << property->getDeclName() << PropertyRValueType in DiagnosePropertyAccessorMismatch()
1722 << property->getDeclName() in DiagnosePropertyAccessorMismatch()
1780 // Exclude property for protocols which conform to class's super-class, in CollectImmediateProperties()
1781 // as super-class has to implement the property. in CollectImmediateProperties()
1812 /// an ivar synthesized for 'Method' and 'Method' is a property accessor
1824 // look up a property declaration whose one of its accessors is implemented in IvarBacksCurrentMethodAccessor()
1826 for (const auto *Property : IFace->instance_properties()) { in IvarBacksCurrentMethodAccessor() local
1827 if ((Property->getGetterName() == IMD->getSelector() || in IvarBacksCurrentMethodAccessor()
1828 Property->getSetterName() == IMD->getSelector()) && in IvarBacksCurrentMethodAccessor()
1829 (Property->getPropertyIvarDecl() == IV)) in IvarBacksCurrentMethodAccessor()
1832 // Also look up property declaration in class extension whose one of its in IvarBacksCurrentMethodAccessor()
1835 for (const auto *Property : Ext->instance_properties()) in IvarBacksCurrentMethodAccessor() local
1836 if ((Property->getGetterName() == IMD->getSelector() || in IvarBacksCurrentMethodAccessor()
1837 Property->getSetterName() == IMD->getSelector()) && in IvarBacksCurrentMethodAccessor()
1838 (Property->getPropertyIvarDecl() == IV)) in IvarBacksCurrentMethodAccessor()
1879 // Is there a matching property synthesize/dynamic? in DefaultSynthesizeProperties()
1884 // Property may have been synthesized by user. in DefaultSynthesizeProperties()
1910 // Suppress the warning if class's superclass implements property's in DefaultSynthesizeProperties()
1911 // getter and implements property's setter (if readwrite property). in DefaultSynthesizeProperties()
1912 // Or, if property is going to be implemented in its super class. in DefaultSynthesizeProperties()
1925 // If property to be implemented in the super class, ignore. in DefaultSynthesizeProperties()
1951 /* property = */ Prop->getIdentifier(), in DefaultSynthesizeProperties()
1985 // When reporting on missing property setter/getter implementation in in DiagnoseUnimplementedAccessor()
2025 // its primary class (and its super classes) if property is in DiagnoseUnimplementedProperties()
2081 // Collect property accessors implemented in current implementation. in DiagnoseUnimplementedProperties()
2101 // Is there a matching property synthesize/dynamic? in DiagnoseUnimplementedProperties()
2121 const auto *property = propertyImpl->getPropertyDecl(); in diagnoseNullResettableSynthesizedSetters() local
2126 (property->getPropertyAttributes() & in diagnoseNullResettableSynthesizedSetters()
2128 property->getGetterMethodDecl() && property->getSetterMethodDecl()) { in diagnoseNullResettableSynthesizedSetters()
2138 << setterImpl->getSelector() << property->getDeclName(); in diagnoseNullResettableSynthesizedSetters()
2158 const ObjCPropertyDecl *Property = I->second; in AtomicPropertySetterGetterRules() local
2162 unsigned Attributes = Property->getPropertyAttributes(); in AtomicPropertySetterGetterRules()
2163 unsigned AttributesAsWritten = Property->getPropertyAttributesAsWritten(); in AtomicPropertySetterGetterRules()
2167 GetterMethod = Property->isClassProperty() ? in AtomicPropertySetterGetterRules()
2168 IMPDecl->getClassMethod(Property->getGetterName()) : in AtomicPropertySetterGetterRules()
2169 IMPDecl->getInstanceMethod(Property->getGetterName()); in AtomicPropertySetterGetterRules()
2170 SetterMethod = Property->isClassProperty() ? in AtomicPropertySetterGetterRules()
2171 IMPDecl->getClassMethod(Property->getSetterName()) : in AtomicPropertySetterGetterRules()
2172 IMPDecl->getInstanceMethod(Property->getSetterName()); in AtomicPropertySetterGetterRules()
2180 << Property->getIdentifier() << 0; in AtomicPropertySetterGetterRules()
2181 Diag(Property->getLocation(), diag::note_property_declare); in AtomicPropertySetterGetterRules()
2186 << Property->getIdentifier() << 1; in AtomicPropertySetterGetterRules()
2187 Diag(Property->getLocation(), diag::note_property_declare); in AtomicPropertySetterGetterRules()
2191 // We only care about readwrite atomic property. in AtomicPropertySetterGetterRules()
2196 Property->getIdentifier(), Property->getQueryKind())) { in AtomicPropertySetterGetterRules()
2210 << Property->getIdentifier() << (GetterMethod != nullptr) in AtomicPropertySetterGetterRules()
2213 if (Property->getLParenLoc().isValid() && in AtomicPropertySetterGetterRules()
2215 // @property () ... case. in AtomicPropertySetterGetterRules()
2217 SemaRef.getLocForEndOfToken(Property->getLParenLoc()); in AtomicPropertySetterGetterRules()
2220 Diag(Property->getLocation(), in AtomicPropertySetterGetterRules()
2223 } else if (Property->getLParenLoc().isInvalid()) { in AtomicPropertySetterGetterRules()
2224 //@property id etc. in AtomicPropertySetterGetterRules()
2226 Property->getTypeSourceInfo()->getTypeLoc().getBeginLoc(); in AtomicPropertySetterGetterRules()
2227 Diag(Property->getLocation(), in AtomicPropertySetterGetterRules()
2232 Diag(Property->getLocation(), diag::note_property_declare); in AtomicPropertySetterGetterRules()
2261 // Look for a getter explicitly declared alongside the property. in DiagnoseOwningPropertyGetterSynthesis()
2339 /// AddPropertyAttrs - Propagates attributes from a property to the
2340 /// implicitly-declared getter or setter for that property.
2342 ObjCPropertyDecl *Property) { in AddPropertyAttrs() argument
2344 for (const auto *A : Property->attrs()) { in AddPropertyAttrs()
2353 /// have the property type and issue diagnostics if they don't.
2356 void SemaObjC::ProcessPropertyDecl(ObjCPropertyDecl *property) { in ProcessPropertyDecl() argument
2359 ObjCContainerDecl *CD = cast<ObjCContainerDecl>(property->getDeclContext()); in ProcessPropertyDecl()
2363 bool IsClassProperty = property->isClassProperty(); in ProcessPropertyDecl()
2365 CD->getClassMethod(property->getGetterName()) : in ProcessPropertyDecl()
2366 CD->getInstanceMethod(property->getGetterName()); in ProcessPropertyDecl()
2374 getClassMethod(property->getGetterName()) : in ProcessPropertyDecl()
2376 getInstanceMethod(property->getGetterName()); in ProcessPropertyDecl()
2379 CD->getClassMethod(property->getSetterName()) : in ProcessPropertyDecl()
2380 CD->getInstanceMethod(property->getSetterName()); in ProcessPropertyDecl()
2385 getClassMethod(property->getSetterName()) : in ProcessPropertyDecl()
2387 getInstanceMethod(property->getSetterName()); in ProcessPropertyDecl()
2388 DiagnosePropertyAccessorMismatch(property, GetterMethod, in ProcessPropertyDecl()
2389 property->getLocation()); in ProcessPropertyDecl()
2396 property->getGetterName(), !IsClassProperty, true, false, CatDecl); in ProcessPropertyDecl()
2398 if (ExistingGetter->isDirectMethod() || property->isDirectProperty()) { in ProcessPropertyDecl()
2399 Diag(property->getLocation(), diag::err_objc_direct_duplicate_decl) in ProcessPropertyDecl()
2400 << property->isDirectProperty() << 1 /* property */ in ProcessPropertyDecl()
2409 if (!property->isReadOnly() && !SetterMethod) { in ProcessPropertyDecl()
2412 property->getSetterName(), !IsClassProperty, true, false, CatDecl); in ProcessPropertyDecl()
2414 if (ExistingSetter->isDirectMethod() || property->isDirectProperty()) { in ProcessPropertyDecl()
2415 Diag(property->getLocation(), diag::err_objc_direct_duplicate_decl) in ProcessPropertyDecl()
2416 << property->isDirectProperty() << 1 /* property */ in ProcessPropertyDecl()
2425 if (!property->isReadOnly() && SetterMethod) { in ProcessPropertyDecl()
2432 property->getType().getNonReferenceType())) { in ProcessPropertyDecl()
2433 Diag(property->getLocation(), in ProcessPropertyDecl()
2435 << property->getDeclName() in ProcessPropertyDecl()
2443 // FIXME: The synthesized property we set here is misleading. We almost always in ProcessPropertyDecl()
2448 // No instance/class method of same name as property getter name was found. in ProcessPropertyDecl()
2451 SourceLocation Loc = property->getLocation(); in ProcessPropertyDecl()
2453 // The getter returns the declared property type with all qualifiers in ProcessPropertyDecl()
2455 QualType resultTy = property->getType().getAtomicUnqualifiedType(); in ProcessPropertyDecl()
2457 // If the property is null_resettable, the getter returns nonnull. in ProcessPropertyDecl()
2458 if (property->getPropertyAttributes() & in ProcessPropertyDecl()
2469 Context, Loc, Loc, property->getGetterName(), resultTy, nullptr, CD, in ProcessPropertyDecl()
2473 (property->getPropertyImplementation() == ObjCPropertyDecl::Optional) in ProcessPropertyDecl()
2478 AddPropertyAttrs(SemaRef, GetterMethod, property); in ProcessPropertyDecl()
2480 if (property->isDirectProperty()) in ProcessPropertyDecl()
2483 if (property->hasAttr<NSReturnsNotRetainedAttr>()) in ProcessPropertyDecl()
2487 if (property->hasAttr<ObjCReturnsInnerPointerAttr>()) in ProcessPropertyDecl()
2491 if (const SectionAttr *SA = property->getAttr<SectionAttr>()) in ProcessPropertyDecl()
2501 // the property with the same name is seen in the @implementation in ProcessPropertyDecl()
2506 property->setGetterMethodDecl(GetterMethod); in ProcessPropertyDecl()
2508 // Skip setter if property is read-only. in ProcessPropertyDecl()
2509 if (!property->isReadOnly()) { in ProcessPropertyDecl()
2512 // No instance/class method of same name as property setter name was in ProcessPropertyDecl()
2516 SourceLocation Loc = property->getLocation(); in ProcessPropertyDecl()
2519 Context, Loc, Loc, property->getSetterName(), Context.VoidTy, nullptr, in ProcessPropertyDecl()
2526 (property->getPropertyImplementation() == ObjCPropertyDecl::Optional) in ProcessPropertyDecl()
2532 property->getType().getUnqualifiedType().getAtomicUnqualifiedType(); in ProcessPropertyDecl()
2534 // If the property is null_resettable, the setter accepts a in ProcessPropertyDecl()
2536 if (property->getPropertyAttributes() & in ProcessPropertyDecl()
2550 property->getIdentifier(), in ProcessPropertyDecl()
2557 AddPropertyAttrs(SemaRef, SetterMethod, property); in ProcessPropertyDecl()
2559 if (property->isDirectProperty()) in ProcessPropertyDecl()
2563 if (const SectionAttr *SA = property->getAttr<SectionAttr>()) in ProcessPropertyDecl()
2575 // the property with the same name is seen in the @implementation in ProcessPropertyDecl()
2580 property->setSetterMethodDecl(SetterMethod); in ProcessPropertyDecl()
2586 // @property double bar; in ProcessPropertyDecl()
2753 // Warn if user supplied no assignment attribute, property is in CheckObjCPropertyAttributes()
2759 // With arc, @property definitions should default to strong when in CheckObjCPropertyAttributes()
2770 // Don't issue warning on property with no life time in class in CheckObjCPropertyAttributes()
2771 // extension as it is inherited from property in primary class. in CheckObjCPropertyAttributes()