[cfe-commits] r44025 - in /cfe/trunk: Parse/ParseObjc.cpp Sema/Sema.h Sema/SemaExpr.cpp include/clang/Parse/Action.h

Fariborz Jahanian fjahanian at apple.com
Thu Dec 13 08:59:46 PST 2007


On Dec 12, 2007, at 6:07 PM, Chris Lattner wrote:

> On Nov 12, 2007, at 12:13 PM, Fariborz Jahanian wrote:
>> Author: fjahanian
>> Date: Mon Nov 12 14:13:27 2007
>> New Revision: 44025
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=44025&view=rev
>> Log:
>> 'super' nailed.
>
> Hi Fariborz, One thing:
>
>> +++ cfe/trunk/Sema/SemaExpr.cpp Mon Nov 12 14:13:27 2007
>> @@ -2060,13 +2060,34 @@
>> +  ObjcInterfaceDecl* ClassDecl = 0;
>> +  if (!strcmp(receiverName->getName(), "super") && CurMethodDecl) {
>> +    ClassDecl = CurMethodDecl->getClassInterface()->getSuperClass();
>> +    if (CurMethodDecl->isInstance()) {
>> +      IdentifierInfo &II = Context.Idents.get("self");
>> +      ExprResult ReceiverExpr = ActOnIdentifierExpr(S, lbrac, II,
>> +                                                    false);
>> +      QualType superTy = Context.getObjcInterfaceType(ClassDecl);
>> +      superTy = Context.getPointerType(superTy);
>> +      ReceiverExpr = ActOnCastExpr(SourceLocation(),  
>> superTy.getAsOpaquePtr(),
>> +                                   SourceLocation(),  
>> ReceiverExpr.Val);
>> +
>> +      return ActOnInstanceMessage(ReceiverExpr.Val, Sel, lbrac,  
>> rbrac,
>> +                                  Args);
>
> This code appears to be synthesizing a definition of super on the  
> fly.  This seems like exactly the same issue as self, etc.   
> Shouldn't it be handled the same way?
Correct. This is related issue.

- Fariborz

>
>
> -Chris




More information about the cfe-commits mailing list