[cfe-dev] ObjCKVCRefExpr class name

Daniel Dunbar daniel at zuster.org
Mon Aug 17 23:41:29 PDT 2009


On Mon, Aug 17, 2009 at 8:43 AM, Fariborz Jahanian<fjahanian at apple.com> wrote:
>
> 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.

I agree with David, I don't see a convincing reason these should be
separate AST nodes. The API should just make it clear that the
contained expression is either a method or a property, and clients can
query this on the ObjCPropertyRefExpr node.

I believe, however, that that was how it used to be, so maybe
something else motivated this change?

 - Daniel

> - 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
>
> _______________________________________________
> 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