aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.h
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-11-03 10:39:15 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-11-03 10:39:15 +0000
commit43236c265b65d3e9447f84272300db648416d37e (patch)
tree343b86bc8aefd1ff013b186a12e04ffedd18269c /gcc/objc/objc-act.h
parent87c20fe7623b31c72d31b015254fd7f7964f2ead (diff)
downloadgcc-43236c265b65d3e9447f84272300db648416d37e.zip
gcc-43236c265b65d3e9447f84272300db648416d37e.tar.gz
gcc-43236c265b65d3e9447f84272300db648416d37e.tar.bz2
In gcc/objc/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (maybe_make_artificial_property_decl): New. (objc_maybe_build_component_ref): Call maybe_make_artificial_property_decl if a property can not be found. Do not call objc_finish_message_expr if PROPERTY_HAS_NO_GETTER. * objc-act.h Updated comments. (PROPERTY_HAS_NO_GETTER): New. (PROPERTY_HAS_NO_SETTER): New. * objc-tree.def: Updated comment. In gcc/testsuite/: 2010-11-03 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/property/dotsyntax-1.m: New. * objc.dg/property/dotsyntax-2.m: New. * obj-c++.dg/property/dotsyntax-1.mm: New. * obj-c++.dg/property/dotsyntax-2.mm: New. From-SVN: r166237
Diffstat (limited to 'gcc/objc/objc-act.h')
-rw-r--r--gcc/objc/objc-act.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index 4c10c01..9478d72 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -62,6 +62,11 @@ tree objc_eh_personality (void);
/* TREE_TYPE is the type (int, float, etc) of the property. */
+/* DECL_ARTIFICIAL is set to 1 if the PROPERTY_DECL is an artificial
+ property declaration created when the dot-syntax object.component
+ is used with no actual @property matching the component, but a
+ valid getter/setter. */
+
/* PROPERTY_NAME is the name of the property. */
#define PROPERTY_NAME(DECL) DECL_NAME(DECL)
@@ -99,9 +104,21 @@ typedef enum objc_property_assign_semantics {
declaration has been parsed); otherwise, it is set to 0. */
#define PROPERTY_DYNAMIC(DECL) DECL_LANG_FLAG_2 (DECL)
+/* PROPERTY_HAS_NO_GETTER can be 0 or 1. Normally it is 0, but if
+ this is an artificial PROPERTY_DECL that we generate even without a
+ getter, it is set to 1. */
+#define PROPERTY_HAS_NO_GETTER(DECL) DECL_LANG_FLAG_3 (DECL)
+
+/* PROPERTY_HAS_NO_SETTER can be 0 or 1. Normally it is 0, but if
+ this is an artificial PROPERTY_DECL that we generate even without a
+ setter, it is set to 1. */
+#define PROPERTY_HAS_NO_SETTER(DECL) DECL_LANG_FLAG_4 (DECL)
/* PROPERTY_REF. A PROPERTY_REF represents an 'object.property'
- expression. */
+ expression. It is normally used for property access, but when
+ the Objective-C 2.0 "dot-syntax" (object.component) is used
+ with no matching property, a PROPERTY_REF is still created to
+ represent it, with an artificial PROPERTY_DECL. */
/* PROPERTY_REF_OBJECT is the object whose property we are
accessing. */
@@ -109,7 +126,9 @@ typedef enum objc_property_assign_semantics {
/* PROPERTY_REF_PROPERTY_DECL is the PROPERTY_DECL for the property
used in the expression. From it, you can get the property type,
- and the getter/setter names. */
+ and the getter/setter names. This PROPERTY_DECL could be artificial
+ if we are processing an 'object.component' syntax with no matching
+ declared property. */
#define PROPERTY_REF_PROPERTY_DECL(NODE) TREE_OPERAND (PROPERTY_REF_CHECK (NODE), 1)