[cfe-dev] ObjCKVCRefExpr class name

David Chisnall csdavec at swansea.ac.uk
Mon Aug 17 05:52:38 PDT 2009


On 17 Aug 2009, at 03:59, Chris Lattner wrote:

> On Aug 16, 2009, at 4:40 PM, David Chisnall wrote:
>
>> Hi,
>>
>> I'm wondering what the rationale behind the name of the  
>> ObjCKVCRefExpr
>> class is.  It is quite confusing to have a class with KVC in its name
>> which has absolutely nothing to do with KVC...
>
> I agree.  Should it be ObjCPropertyRefExpr?

We already have an ObjCPropertyRefExpr.  The difference appears to be  
that ObjCPropertyRefExpr is generated when the property is declared as  
a property and ObjCKVCRefExpr is generated when the property is  
declared as a method.  Maybe ObjCImplicitPropertyRefExpr?

I'm not fully sure why these are different, since they generate the  
same code.  It might be nice if we only got the unused expression  
result from a property ref expression that invoked a declared property  
and not for using dot notation to invoke other methods (since other  
methods invoked in this way may alter the state), although it's still  
very bad style to use the dot notation in this way (or at all,  
depending on who you ask).

David



More information about the cfe-dev mailing list