[cfe-commits] [PATCH] ObjC: interface decls pointing to implementation decls

steve naroff snaroff at apple.com
Mon Jul 20 12:01:48 PDT 2009


On Jul 20, 2009, at 2:45 PM, Argyrios Kyrtzidis wrote:

>
> On Jul 20, 2009, at 11:34 AM, steve naroff wrote:
>
>>
>> Looks great.
>
> Ok, unless someone objects (soon), I'm going to commit the set of  
> patches.
>

 From my perspective, you are good to go.

>> I really like the following "convenience" functions:
>>
>> +ObjCImplementationDecl *ObjCInterfaceDecl::getImplementation()  
>> const {
>> +  return getASTContext().getObjCImplementation(
>> +                                           
>> const_cast<ObjCInterfaceDecl*>(this));
>> +}
>> +
>> +void ObjCInterfaceDecl::setImplementation(ObjCImplementationDecl  
>> *ImplD) {
>> +  getASTContext().setObjCImplementation(this, ImplD);
>> +}
>> +
>>
>> Now that every Decl can get a pointer to it's ASTContext (something  
>> Chris reminded me of earlier today), I bet there are other  
>> interesting space optimizations that we can make to decls  
>> (*without* complicating the API:-). For example, *every*  
>> ParmVarDecl currently has a DefaultArg slot (that is only available  
>> for C++). Cocoa.h has 30,000 ParmVarDecl's! Might be interesting to  
>> consider using an ASTContext Map to store these as well.
>
> On this particular case, is there a reason we don't reuse VarDecl's  
> Init Stmt* field for C++ default arg ?
>

I think Doug is the best person to ask (I believe he added it). Could  
just be cleanup (based on timing of when the 2 were added)...

snaroff

> -Argiris




More information about the cfe-commits mailing list