[cfe-dev] ObjCKVCRefExpr class name

Fariborz Jahanian fjahanian at apple.com
Mon Aug 17 08:43:43 PDT 2009


On Aug 17, 2009, at 5:52 AM, David Chisnall wrote:

> 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

Other clients may want to distinguish the two. ObjCKVCRefExpr always
has (presumed to have) side-effect while ObjCPropertyRefExpr generally
does not if fully synthesize by the compiler.

- Fariborz

>
> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list