aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.h
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-11-06 13:14:55 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-11-06 13:14:55 +0000
commita9625a91d2cd2ef2cc6d82f6ace9be5199745fdf (patch)
treeae27652f67777ee67c50f37fbe2dd448c1a7dafa /gcc/objc/objc-act.h
parentcd746c2704ed7cc2204ac3e76d6369c710d05176 (diff)
downloadgcc-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-act.h')
-rw-r--r--gcc/objc/objc-act.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index 9478d72..9a9cacd 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -131,6 +131,15 @@ typedef enum objc_property_assign_semantics {
declared property. */
#define PROPERTY_REF_PROPERTY_DECL(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 1)
+/* PROPERTY_REF_GETTER_CALL is the getter call expression, ready to
+ use at gimplify time if needed. Generating the getter call
+ requires modifying the selector table, and, in the case of
+ self/super, requires the context to be generated correctly. The
+ gimplify stage is too late to do these things, so we generate the
+ getter call earlier instead, and keep it here in case we need to
+ use it. */
+#define PROPERTY_REF_GETTER_CALL(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 2)
+
/* CLASS_INTERFACE_TYPE, CLASS_IMPLEMENTATION_TYPE,
CATEGORY_INTERFACE_TYPE, CATEGORY_IMPLEMENTATION_TYPE,