[cfe-commits] r44156 - in /cfe/trunk: Driver/RewriteTest.cpp Sema/SemaExpr.cpp include/clang/AST/Expr.h

Fariborz Jahanian fjahanian at apple.com
Thu Nov 15 09:33:17 PST 2007


On Nov 14, 2007, at 9:41 PM, Chris Lattner wrote:

>
> On Nov 14, 2007, at 6:58 PM, Steve Naroff wrote:
>
>> Author: snaroff
>> Date: Wed Nov 14 20:58:25 2007
>> New Revision: 44156
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=44156&view=rev
>> Log:
>>
>> - Implement ivar rewrite (patch by Fariborz).
>> - RewriteMessageExpr()...make implicit casts explicit with
>> synthesizing call (removing warnings when calling objc_msgSend()).
>
> ...
>
>> --- cfe/trunk/include/clang/AST/Expr.h (original)
>> +++ cfe/trunk/include/clang/AST/Expr.h Wed Nov 14 20:58:25 2007
>> @@ -1256,18 +1256,23 @@
>>  class ObjcIvarDecl *D;
>>  SourceLocation Loc;
>>  Expr *Base;
>> -  bool IsArrow;      // True if this is "X->F", false if this is
>> "X.F".
>> +  bool IsArrow:1;      // True if this is "X->F", false if this is
>> "X.F".
>> +  bool IsFreeIvar:1;   // True if ivar reference has no base (self
>> assumed).
>
> What is IsFreeIvar used for?  Shouldn't references to fields of the
> current objects just use a declrefexpr?

It is ivar reference without the base expressions ('self') is assumed.  
This is to 'attach' the base during rewrite and also for pretty  
printing to come out exactly as user wrote the code. Use of  
declrefexpr probably masks what user wrote.

- fariborz

>
>
> -Chris
> _______________________________________________
> 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