[cfe-dev] Objective-C tidy up

David Chisnall csdavec at swansea.ac.uk
Tue Jun 3 08:37:26 PDT 2008


On 3 Jun 2008, at 16:32, Ted Kremenek wrote:

>
> On Jun 3, 2008, at 4:39 AM, David Chisnall wrote:
>
>>> Why should self and _cmd be ParmVarDecls?  Shouldn't they be
>>> PredefinedExprs?
>>
>> That's what I did to start with, but PredefinedExprs need special
>> handling in codegen, while ParmVarDecls are automatically turned into
>> loads of %var.addr.  Since they are parameters, and since it
>> simplifies the rest of the implementation, it seemed like a
>> ParmVarDecl would be the right thing to choose.
>
> The codegen is not the only consumer of the ASTs.  We should go with  
> the solution that makes more sense in the general case.

To me, having parameters being ParamVarDecls did make more sense in  
the general case.  It is also more flexible - if they are  
PredefinedExprs, then you are going to need extra special cases in all  
of these AST consumers for each runtime that exposes others.  If they  
are ParamVarDecls then you use the same handling in your consumer for  
implicit and explicit parameters unless you explicitly need to know  
the difference.

David



More information about the cfe-dev mailing list