[cfe-commits] r61144 - /cfe/trunk/lib/AST/DeclObjC.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Dec 17 10:39:09 PST 2008


On Dec 17, 2008, at 10:35 AM, steve naroff wrote:

>
> On Dec 17, 2008, at 1:25 PM, Fariborz Jahanian wrote:
>
>> Author: fjahanian
>> Date: Wed Dec 17 12:25:24 2008
>> New Revision: 61144
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=61144&view=rev
>> Log:
>> Added comment to Steve's patch to clarify the case.
>>
>>
>> Modified:
>>   cfe/trunk/lib/AST/DeclObjC.cpp
>>
>> Modified: cfe/trunk/lib/AST/DeclObjC.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=61144&r1=61143&r2=61144&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/lib/AST/DeclObjC.cpp (original)
>> +++ cfe/trunk/lib/AST/DeclObjC.cpp Wed Dec 17 12:25:24 2008
>> @@ -369,6 +369,9 @@
>> ///
>> FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext  
>> &Context,
>>                                                     const  
>> ObjCIvarDecl *ivar) {
>> +  /* When a super class's ivar is referenced in the subclass  
>> method with no ivar
>> +     of its own, record for the sub-class is not built yet. Build  
>> it lazily
>> +     here. */
>
> Fariborz,
>
> Thanks for adding the comment, however I'm hoping it's temporary.
>
> I think it makes sense to always build it lazily (which I believe is  
> your plan).
>
> Currently, the only lazy case is when you have no ivars & no curlies:
>
> @interface X : S @end
>
> Note that this obscure case is *not* lazy:
>
> @interface X : S { } @end
>
> From my perspective, having some cases be lazy and some cases not be  
> lazy is confusing (and more likely to be buggy).
>
> No rush on this (since the patch/comment will work fine for now). I  
> just wanted to make sure we revisit this...

Yes. I have another case of lazily building it. I will revisit this as  
soon as I am done with something else. Looks to me
that lazily building always works and it was 'lazy' of me not to do it  
to begin with :).

- fariborz

>
>
> Thanks,
>
> snaroff
>
>>
>>  if (!RecordForDecl)
>>    addRecordToClass(Context);
>>  assert(RecordForDecl && "lookupFieldDeclForIvar no storage for  
>> class");
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list