[cfe-commits] r60035 - in /cfe/trunk: lib/AST/Expr.cpp test/Analysis/ObjCProperties.m test/SemaObjC/property-category-1.m
Fariborz Jahanian
fjahanian at apple.com
Tue Nov 25 10:58:02 PST 2008
On Nov 25, 2008, at 10:37 AM, Chris Lattner wrote:
> On Nov 25, 2008, at 9:56 AM, Fariborz Jahanian wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=60035&view=rev
>> Log:
>> Patch to allow over-riding of readonly property to
>> a writable property in one of its category.
>
> cool.
>
>> + PTy->getPointeeType()->getAsObjCInterfaceType();
>> + ObjCInterfaceDecl *IFace = IFTy->getDecl();
>> + for (ObjCCategoryDecl *Category = IFace->getCategoryList();
>> + Category; Category = Category-
>> >getNextClassCategory()) {
>> + PDecl= Category->FindPropertyDeclaration(PDecl-
>> >getIdentifier());
>> + if (PDecl && !PDecl->isReadOnly())
>> + return MLV_Valid;
>> + }
>
> Does this loop happen in other places? If so, maybe this should be
> a helper method on ObjCInterfaceDecl? There are a lot of "walk the
> class hierarchy and look for stuff" loops in the ObjC support, it
> would be nice to factor them somehow.
We loop over the categories for different purposes, but this is the
only place where readonly check is intended. I will factor this into its
own method in case we need it for some other purposes (which I do not
know at this time).
- Fariborz
>
>
> -Chris
>
More information about the cfe-commits
mailing list