[cfe-commits] r89181 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Tue Nov 17 18:57:28 PST 2009


On Nov 17, 2009, at 5:56 PM, Fariborz Jahanian wrote:

>
> On Nov 17, 2009, at 5:29 PM, Douglas Gregor wrote:
>
>> Author: dgregor
>> Date: Tue Nov 17 19:29:02 2009
>> New Revision: 89181
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=89181&view=rev
>> Log:
>> Eliminate some completely-redundant lookups
>
> Are you sure about this. Look up is for properties declared in the  
> interface types's list of protocol qualifiers.

Yes, I'm sure. There were two copies of this same code, right next to  
each other. This is the one that's still there:

     for (ObjCObjectPointerType::qual_iterator I = OPT->qual_begin(),
          E = OPT->qual_end(); I != E; ++I)
       if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration 
(Member)) {
         // Check whether we can reference this property.
         if (DiagnoseUseOfDecl(PD, MemberLoc))
           return ExprError();

         return Owned(new (Context) ObjCPropertyRefExpr(PD, PD->getType 
(),
                                                        MemberLoc,  
BaseExpr));
       }

Incidentally, that PD->getType() should probably be PD->getType 
().getNonReferenceType().
	- Doug

> - Fariborz
>
>>
>> Modified:
>>   cfe/trunk/lib/Sema/SemaExpr.cpp
>>
>> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=89181&r1=89180&r2=89181&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
>> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Nov 17 19:29:02 2009
>> @@ -2376,16 +2376,6 @@
>>        return Owned(new (Context) ObjCPropertyRefExpr(PD, PD- 
>> >getType(),
>>                                                       MemberLoc,  
>> BaseExpr));
>>      }
>> -    for (ObjCObjectPointerType::qual_iterator I = OPT->qual_begin(),
>> -         E = OPT->qual_end(); I != E; ++I)
>> -      if (ObjCPropertyDecl *PD = (*I)->FindPropertyDeclaration 
>> (Member)) {
>> -        // Check whether we can reference this property.
>> -        if (DiagnoseUseOfDecl(PD, MemberLoc))
>> -          return ExprError();
>> -
>> -        return Owned(new (Context) ObjCPropertyRefExpr(PD, PD- 
>> >getType(),
>> -                                                       MemberLoc,  
>> BaseExpr));
>> -      }
>>    // If that failed, look for an "implicit" property by seeing if  
>> the nullary
>>    // selector is implemented.
>>
>>
>>
>> _______________________________________________
>> 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