diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-11-06 13:14:55 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-11-06 13:14:55 +0000 |
commit | a9625a91d2cd2ef2cc6d82f6ace9be5199745fdf (patch) | |
tree | ae27652f67777ee67c50f37fbe2dd448c1a7dafa /gcc/objc/objc-tree.def | |
parent | cd746c2704ed7cc2204ac3e76d6369c710d05176 (diff) | |
download | gcc-a9625a91d2cd2ef2cc6d82f6ace9be5199745fdf.zip gcc-a9625a91d2cd2ef2cc6d82f6ace9be5199745fdf.tar.gz gcc-a9625a91d2cd2ef2cc6d82f6ace9be5199745fdf.tar.bz2 |
In gcc/objc/: 2010-11-05 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-11-05 Nicola Pero <nicola.pero@meta-innovation.com>
Fixed using the Objective-C 2.0 syntax with self and super.
* objc-act.c (OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS): New.
(maybe_make_artificial_property_decl): Added 'implementation'
argument. Use OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS when
looking up getters or setters for a class. If an implementation
is specified, search it as well for a getter or setter.
(objc_maybe_build_component_ref): Updated calls to
maybe_make_artificial_property_decl; added code to deal with
'self' and 'super' and with methods declared locally in the
implementation. Store the getter call expression in the
PROPERTY_REF instead of throwing it away.
(objc_build_class_component_ref): Updated calls to
maybe_make_artificial_property_decl, and store the getter call
expression in PROPERTY_REF instead of throwing it away.
(lookup_method_static): Implemented
OBJC_LOOKUP_NO_INSTANCE_METHODS_OF_ROOT_CLASS option.
(objc_gimplify_property_ref): Do not build the getter method call
here; instead use the one stored in the PROPERTY_REF. If it's not
there, produce helpful error messages.
* objc-tree.def (PROPERTY_REF): Increased the number of operands
from 2 to 3. Updated comments.
* objc-act.h (PROPERTY_REF_GETTER_CALL): New.
In gcc/testsuite/:
2010-11-05 Nicola Pero <nicola.pero@meta-innovation.com>
Fixed using the Objective-C 2.0 dot-syntax with self and super.
* objc.dg/property/dotsyntax-5.m: New.
* objc.dg/property/dotsyntax-6.m: New.
* objc.dg/property/dotsyntax-7.m: New.
* objc.dg/property/dotsyntax-8.m: New.
* objc.dg/property/dotsyntax-9.m: New.
* objc.dg/property/dotsyntax-10.m: New.
* objc.dg/property/dotsyntax-11.m: New.
* obj-c++.dg/property/dotsyntax-5.mm: New.
* obj-c++.dg/property/dotsyntax-6.mm: New.
* obj-c++.dg/property/dotsyntax-7.mm: New.
* obj-c++.dg/property/dotsyntax-8.mm: New.
* obj-c++.dg/property/dotsyntax-9.mm: New.
* obj-c++.dg/property/dotsyntax-10.mm: New.
* obj-c++.dg/property/dotsyntax-11.mm: New.
From-SVN: r166402
Diffstat (limited to 'gcc/objc/objc-tree.def')
-rw-r--r-- | gcc/objc/objc-tree.def | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/objc/objc-tree.def b/gcc/objc/objc-tree.def index 7316675..e33fc78 100644 --- a/gcc/objc/objc-tree.def +++ b/gcc/objc/objc-tree.def @@ -44,9 +44,11 @@ DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", tcc_expression, 1) where 'object' is an Objective-C object and 'property' is an Objective-C property. Operand 0 is the object (the tree representing the expression), and Operand 1 is the property (the - PROPERTY_DECL). A PROPERTY_REF tree needs to be transformed into - 'setter' and 'getter' calls at some point; at the moment this - happens in two places: + PROPERTY_DECL). Operand 2 is the 'getter' call, ready to be used; + we pregenerate it because it is hard to generate it properly later + on. A PROPERTY_REF tree needs to be transformed into 'setter' and + 'getter' calls at some point; at the moment this happens in two + places: * if we detect that a modify expression is being applied to a PROPERTY_REF, then we transform that into a 'getter' call (this @@ -54,13 +56,15 @@ DEFTREECODE (CLASS_REFERENCE_EXPR, "class_reference_expr", tcc_expression, 1) * else, it will remain as a PROPERTY_REF until we get to gimplification; at that point, we convert each PROPERTY_REF into - a 'getter' call during ObjC/ObjC++ gimplify. + a 'getter' call during ObjC/ObjC++ gimplify. At that point, it + is quite hard to build a 'getter' call, but we have already built + it and we just need to swap Operand 2 in. Please note that when the Objective-C 2.0 "dot-syntax" 'object.component' is encountered, where 'component' is not a property but there are valid setter/getter methods for it, an artificial PROPERTY_DECL is generated and used in the PROPERTY_REF. */ -DEFTREECODE (PROPERTY_REF, "property_ref", tcc_expression, 2) +DEFTREECODE (PROPERTY_REF, "property_ref", tcc_expression, 3) /* Local variables: |