[cfe-commits] r79365 - in /cfe/trunk: include/clang/AST/ include/clang/Frontend/ lib/AST/ lib/Analysis/ lib/CodeGen/ lib/Frontend/ lib/Sema/
Fariborz Jahanian
fjahanian at apple.com
Thu Aug 20 10:05:07 PDT 2009
On Aug 19, 2009, at 9:28 PM, Chris Lattner wrote:
>
> On Aug 18, 2009, at 1:50 PM, Fariborz Jahanian wrote:
>
>> Author: fjahanian
>> Date: Tue Aug 18 15:50:23 2009
>> New Revision: 79365
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=79365&view=rev
>> Log:
>> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
>> Removed an unnecessary loop to get to setters incoming
>> argument. Added DoxyGen comments. Still more work
>> to do in this area (WIP).
>
> Thanks Fariborz! How about "ObjCImplicitSetterGetterRefExpr"
> instead of "ObjCImplctSetterGetterRefExpr"?
Renamed.
>
>
>> +/// ObjCImplctSetterGetterRefExpr - A dot-syntax expression to
>> access two
>> +/// methods; one to set a value to an 'ivar' (Setter) and the
>> other to access
>> +/// an 'ivar' (Setter).
>> +/// An example for use of this AST is:
>> +/// @code
>> +/// @interface Test { }
>> +/// - (Test *)crash;
>> +/// - (void)setCrash: (Test*)value;
>> +/// @end
>> +/// void foo(Test *p1, Test *p2)
>> +/// {
>> +/// p2.crash = p1.crash; // Uses ObjCImplctSetterGetterRefExpr
>> AST
>> +/// }
>> +/// @endcode
>
> Very nice! Can the 'base' be null? If so, what does that mean and
> when does it happen?
Base is null when we have a class method for getter/setter. This is
for feature completeness and
I am not sure of it was ever used.
>
>
>> +class ObjCImplctSetterGetterRefExpr : public Expr {
>> + /// Setter - Setter method user declared for setting its 'ivar'
>> to a value
>> ObjCMethodDecl *Setter;
>> + /// Getter - Getter method user declared for accessing 'ivar' it
>> controls.
>> ObjCMethodDecl *Getter;
>
> Are the getter and setter always non-null?
Yes. However, we have a bug which does not catch getter being null.
This results in ICE at Code gen time.
I will fix it next. Setter being null, however, is diagnosed by clang.
>
>
>
>> SourceLocation Loc;
>> // FIXME: Swizzle these into a single pointer.
>> @@ -272,22 +283,23 @@
>> SourceLocation ClassLoc;
>
> Please rename and comment the "Loc" fields to indicate what they are
> the loc of.
Done. http://llvm.org/viewvc/llvm-project?view=rev&revision=79537
- fariborz
>
>
> -Chris
More information about the cfe-commits
mailing list