Lines Matching refs:ObjCPropertyDecl
37 ObjCPropertyDecl::PropertyAttributeKind attrs,
41 if (attrs & (ObjCPropertyDecl::OBJC_PR_retain |
42 ObjCPropertyDecl::OBJC_PR_strong |
43 ObjCPropertyDecl::OBJC_PR_copy)) {
45 } else if (attrs & ObjCPropertyDecl::OBJC_PR_weak) {
47 } else if (attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) {
53 if (attrs & ObjCPropertyDecl::OBJC_PR_assign &&
62 static void checkARCPropertyDecl(Sema &S, ObjCPropertyDecl *property) {
65 ObjCPropertyDecl::PropertyAttributeKind propertyKind
80 ObjCPropertyDecl::PropertyAttributeKind attr;
82 attr = ObjCPropertyDecl::OBJC_PR_strong;
84 attr = ObjCPropertyDecl::OBJC_PR_weak;
87 attr = ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
149 checkARCPropertyDecl(*this, cast<ObjCPropertyDecl>(Res));
154 ObjCPropertyDecl *Res = CreatePropertyDecl(S, ClassDecl, AtLoc, LParenLoc, FD,
172 static ObjCPropertyDecl::PropertyAttributeKind
176 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readonly;
178 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readwrite;
180 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_getter;
182 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_setter;
184 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_assign;
186 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_retain;
188 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_strong;
190 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_weak;
192 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_copy;
194 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
196 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_nonatomic;
198 attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_atomic;
200 return (ObjCPropertyDecl::PropertyAttributeKind)attributesAsWritten;
228 if (ObjCPropertyDecl *prevDecl =
229 ObjCPropertyDecl::findPropertyDecl(ClsExtDecl, PropertyId)) {
236 // Create a new ObjCPropertyDecl with the DeclContext being
239 ObjCPropertyDecl *PDecl =
240 ObjCPropertyDecl::Create(Context, DC, FD.D.getIdentifierLoc(),
245 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
247 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
263 ObjCPropertyDecl *PIDecl =
269 ObjCPropertyDecl *PrimaryPDecl =
308 if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
310 (ObjCPropertyDecl::OBJC_PR_retain |
311 ObjCPropertyDecl::OBJC_PR_strong |
312 ObjCPropertyDecl::OBJC_PR_copy |
313 ObjCPropertyDecl::OBJC_PR_nonatomic);
320 if (!ObjCPropertyDecl::findPropertyDecl(DC,
325 // and ObjCPropertyDecl::PropertyAttributeKind have identical
341 PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy);
345 PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
347 PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
349 PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
358 (PIkind & ObjCPropertyDecl::OBJC_PR_readwrite)
375 ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S,
409 ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC,
413 if (ObjCPropertyDecl *prevDecl =
414 ObjCPropertyDecl::findPropertyDecl(DC, PropertyId)) {
440 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
443 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
446 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
449 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
452 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
455 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
458 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
461 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
464 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
467 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
471 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
473 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
477 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
479 PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
482 PDecl->setPropertyImplementation(ObjCPropertyDecl::Required);
484 PDecl->setPropertyImplementation(ObjCPropertyDecl::Optional);
490 ObjCPropertyDecl *property,
529 & ObjCPropertyDecl::OBJC_PR_assign) != 0);
549 ObjCPropertyDecl *property, ObjCIvarDecl *ivar) {
558 property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
565 property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
567 property->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
591 ObjCPropertyDecl *property = 0;
611 if ((PIkind & (ObjCPropertyDecl::OBJC_PR_atomic |
612 ObjCPropertyDecl::OBJC_PR_nonatomic) ) == 0) {
670 ObjCPropertyDecl::OBJC_PR_readonly) &&
675 ObjCPropertyDecl::PropertyAttributeKind kind
679 if ((kind & ObjCPropertyDecl::OBJC_PR_weak) &&
701 !(kind & ObjCPropertyDecl::OBJC_PR_strong)) {
730 if (kind & ObjCPropertyDecl::OBJC_PR_weak &&
883 ObjCPropertyDecl::OBJC_PR_atomic) {
970 Sema::DiagnosePropertyMismatch(ObjCPropertyDecl *Property,
971 ObjCPropertyDecl *SuperProperty,
973 ObjCPropertyDecl::PropertyAttributeKind CAttr =
975 ObjCPropertyDecl::PropertyAttributeKind SAttr =
977 if ((CAttr & ObjCPropertyDecl::OBJC_PR_readonly)
978 && (SAttr & ObjCPropertyDecl::OBJC_PR_readwrite))
981 if ((CAttr & ObjCPropertyDecl::OBJC_PR_copy)
982 != (SAttr & ObjCPropertyDecl::OBJC_PR_copy))
985 else if (!(SAttr & ObjCPropertyDecl::OBJC_PR_readonly)){
988 (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_strong));
991 (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_strong));
999 if ((CAttr & ObjCPropertyDecl::OBJC_PR_nonatomic)
1000 != (SAttr & ObjCPropertyDecl::OBJC_PR_nonatomic))
1030 bool Sema::DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *property,
1062 ObjCPropertyDecl *SuperPDecl = (*S);
1066 ObjCPropertyDecl *PDecl = (*I);
1088 ObjCPropertyDecl *Pr = (*P);
1102 ObjCPropertyDecl *Pr = (*P);
1170 bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
1189 ObjCPropertyDecl *P =
1221 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>& PropMap,
1222 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>& SuperPropMap) {
1226 ObjCPropertyDecl *Prop = (*P);
1239 ObjCPropertyDecl *Prop = (*P);
1250 ObjCPropertyDecl *Prop = (*P);
1251 ObjCPropertyDecl *PropertyFromSuper = SuperPropMap[Prop->getIdentifier()];
1256 ObjCPropertyDecl *&PropEntry = PropMap[Prop->getIdentifier()];
1272 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>& PropMap) {
1276 ObjCPropertyDecl *Prop = (*P);
1287 ObjCPropertyDecl *Prop = (*P);
1302 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>& PropMap) {
1313 ObjCPropertyDecl *Sema::LookupPropertyDecl(const ObjCContainerDecl *CDecl,
1319 ObjCPropertyDecl *Prop = (*P);
1327 ObjCPropertyDecl *Prop = LookupPropertyDecl((*PI), II);
1336 ObjCPropertyDecl *Prop = (*P);
1343 ObjCPropertyDecl *Prop = LookupPropertyDecl((*PI), II);
1351 static IdentifierInfo * getDefaultSynthIvarName(ObjCPropertyDecl *Prop,
1366 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> PropMap;
1370 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> SuperPropMap;
1373 for (llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>::iterator
1375 ObjCPropertyDecl *Prop = P->second;
1381 Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
1388 if (Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_readonly)
1427 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> SuperPropMap;
1431 llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> PropMap;
1436 llvm::DenseSet<ObjCPropertyDecl *> PropImplMap;
1442 for (llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>::iterator
1444 ObjCPropertyDecl *Prop = P->second;
1447 Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
1490 ObjCPropertyDecl *Property = (*I);
1498 if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic) &&
1499 !(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_nonatomic)) {
1518 if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
1519 !(Attributes & ObjCPropertyDecl::OBJC_PR_readwrite))
1556 else if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic)) {
1581 const ObjCPropertyDecl *PD = PID->getPropertyDecl();
1603 ObjCPropertyDecl *Property) {
1620 void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
1622 ObjCPropertyDecl *redeclaredProperty,
1633 ObjCPropertyDecl::PropertyAttributeKind CAttr =
1635 if ((!(CAttr & ObjCPropertyDecl::OBJC_PR_readonly)) &&
1671 ObjCPropertyDecl::Optional) ?
1710 ObjCPropertyDecl::Optional) ?
1765 ObjCPropertyDecl *PropertyDecl = cast<ObjCPropertyDecl>(PDecl);
1911 PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);