[cfe-commits] r101972 - in /cfe/trunk: include/clang/AST/ include/clang/Checker/BugReporter/ lib/AST/ lib/Checker/ lib/CodeGen/ lib/Frontend/ lib/Index/ lib/Sema/ tools/CIndex/

Fariborz Jahanian fjahanian at apple.com
Wed Apr 21 10:07:26 PDT 2010


On Apr 20, 2010, at 5:45 PM, Douglas Gregor wrote:

> Author: dgregor
> Date: Tue Apr 20 19:45:42 2010
> New Revision: 101972
>
> URL: http://llvm.org/viewvc/llvm-project?rev=101972&view=rev
> Log:
> Overhaul the AST representation of Objective-C message send
> expressions, to improve source-location information, clarify the
> actual receiver of the message, and pave the way for proper C++
> support. The ObjCMessageExpr node represents four different kinds of
> message sends in a single AST node:
>
>  1) Send to a object instance described by an expression (e.g., [x  
> method:5])
>  2) Send to a class described by the class name (e.g., [NSString  
> method:5])
>  3) Send to a superclass class (e.g, [super method:5] in class method)
>  4) Send to a superclass instance (e.g., [super method:5] in  
> instance method)
>
> Previously these four cases where tangled together. Now, they have
> more distinct representations. Specific changes:
>
> ed Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
> +    NumArgs * sizeof(Expr *);

This is really nice work. One minor comment. Isn't it more expressive  
if you use
llvm's anonymous union to represent selector/method prototype. I am not
sure what the overhead would be though.  The other comment
that I have is how does 'Class' or  'id' receivers are represented in  
the AST (they
must have or tests would have failed).

- Fariborz




More information about the cfe-commits mailing list