summaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-27 05:23:08 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-27 05:23:08 +0000
commit7590f0e5e646477319ef943aa1715eb670aa314e (patch)
treeba6ae21d33b46a8fb8b884194c9eb79ecdd38f48 /gcc/c-family
parent1d894bcf47c398d81f7ea42eff8a5da823799bf7 (diff)
downloadgcc-7590f0e5e646477319ef943aa1715eb670aa314e.tar.gz
In gcc/:
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com> * c-parser.c (c_parser_objc_at_property_declaration): Recognize RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC. Do not use objc_set_property_attr, but use local variables instead. Detect repeated usage of setter, getter and ivar attributes. Improved error processing when a setter name does not end in ':'. Do not check for CPP_CLOSE_PAREN after we determined that the token is a keyword. Updated call to objc_add_property_declaration. In gcc/cp/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com> * parser.c (cp_parser_objc_at_property_declaration): Recognize RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC. Do not use objc_set_property_attr, but use local variables instead. Detect repeated usage of setter, getter and ivar attributes. Improved error processing when a setter name does not end in ':'. Do not check for CPP_CLOSE_PAREN after we determined that the token is a keyword. Updated call to objc_add_property_declaration. In gcc/c-family/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com> * c-common.h (enum rid): Added RID_READWRITE, RID_ASSIGN, RID_RETAIN, RID_COPY and RID_NONATOMIC. Updated RID_FIRST_PATTR and RID_LAST_PATTR. (objc_add_property_declaration): Added additional arguments. (objc_property_attribute_kind): Removed. (objc_set_property_attr): Removed. * c-common.c (c_common_reswords): Added readwrite, assign, retain, copy and nonatomic. * stub-objc.c (objc_add_property_declaration): Added additional arguments. (objc_set_property_attr): Removed. In gcc/objc/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (objc_add_property_declaration): Added arguments to pass the various property attributes that were parsed with the property declaration. Process arguments to determine the final property attributes and produce error messages as appropriate. Added temporary code to keep the compiler silent about variables set but not used - for new attributes that are only checked but have no effect yet. (property_readonly): Removed. (property_setter): Removed. (property_getter): Removed. (property_ivar): Removed. (property_copies): Removed. (objc_set_property_attr): Removed. * objc-act.h (enum property_assign_semantics): New. In gcc/testsuite/: 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com> * obj-c.dg/property/at-property-4.m: New. * obj-c++.dg/property/at-property-4.mm: New. * obj-c++.dg/property/property-neg-5.m: Updated testcase for updates in warning. * obj-c++.dg/property/property-neg-5.mm: Updated testcase for updates in warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165997 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog14
-rw-r--r--gcc/c-family/c-common.c10
-rw-r--r--gcc/c-family/c-common.h28
-rw-r--r--gcc/c-family/stub-objc.c20
4 files changed, 46 insertions, 26 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d742912f8ab..4f30512870b 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,19 @@
2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
+ * c-common.h (enum rid): Added RID_READWRITE, RID_ASSIGN,
+ RID_RETAIN, RID_COPY and RID_NONATOMIC. Updated RID_FIRST_PATTR
+ and RID_LAST_PATTR.
+ (objc_add_property_declaration): Added additional arguments.
+ (objc_property_attribute_kind): Removed.
+ (objc_set_property_attr): Removed.
+ * c-common.c (c_common_reswords): Added readwrite, assign, retain,
+ copy and nonatomic.
+ * stub-objc.c (objc_add_property_declaration): Added additional
+ arguments.
+ (objc_set_property_attr): Removed.
+
+2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
+
* c-common.h (objc_add_property_variable): Renamed to
objc_add_property_declaration. Added location argument.
* stub-objc.c (objc_add_property_variable): Same change.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 2f205adf3ec..a847be27ccd 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -556,10 +556,16 @@ const struct c_common_resword c_common_reswords[] =
{ "oneway", RID_ONEWAY, D_OBJC },
{ "out", RID_OUT, D_OBJC },
/* These are recognized inside a property attribute list */
- { "readonly", RID_READONLY, D_OBJC },
- { "copies", RID_COPIES, D_OBJC },
+ { "assign", RID_ASSIGN, D_OBJC },
+ { "copy", RID_COPY, D_OBJC },
{ "getter", RID_GETTER, D_OBJC },
+ { "nonatomic", RID_NONATOMIC, D_OBJC },
+ { "readonly", RID_READONLY, D_OBJC },
+ { "readwrite", RID_READWRITE, D_OBJC },
+ { "retain", RID_RETAIN, D_OBJC },
{ "setter", RID_SETTER, D_OBJC },
+ /* The following two will be removed once @synthesize is fully implemented. */
+ { "copies", RID_COPIES, D_OBJC },
{ "ivar", RID_IVAR, D_OBJC },
};
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 55637659946..aa877d43583 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -82,7 +82,13 @@ enum rid
/* ObjC ("PATTR" reserved words - they do not appear after a '@'
and are keywords only as property attributes) */
- RID_READONLY, RID_COPIES, RID_GETTER, RID_SETTER, RID_IVAR,
+ RID_GETTER, RID_SETTER,
+ RID_READONLY, RID_READWRITE,
+ RID_ASSIGN, RID_RETAIN, RID_COPY,
+ /* RID_IVAR and RID_COPIES will be removed once @synthesize is
+ completed. */
+ RID_COPIES, RID_IVAR,
+ RID_NONATOMIC,
/* C (reserved and imaginary types not implemented, so any use is a
syntax error) */
@@ -187,8 +193,8 @@ enum rid
RID_LAST_AT = RID_AT_IMPLEMENTATION,
RID_FIRST_PQ = RID_IN,
RID_LAST_PQ = RID_ONEWAY,
- RID_FIRST_PATTR = RID_READONLY,
- RID_LAST_PATTR = RID_IVAR
+ RID_FIRST_PATTR = RID_GETTER,
+ RID_LAST_PATTR = RID_NONATOMIC
};
#define OBJC_IS_AT_KEYWORD(rid) \
@@ -431,16 +437,6 @@ extern c_language_kind c_language;
#define c_dialect_cxx() ((c_language & clk_cxx) != 0)
#define c_dialect_objc() ((c_language & clk_objc) != 0)
-/* ObjC Property Attribute types. */
-typedef enum objc_property_attribute_kind {
- OBJC_PATTR_INIT = 0,
- OBJC_PATTR_READONLY = 1,
- OBJC_PATTR_GETTER = 2,
- OBJC_PATTR_SETTER = 3,
- OBJC_PATTR_IVAR = 4,
- OBJC_PATTR_COPIES = 5
-} objc_property_attribute_kind;
-
/* ObjC ivar visibility types. */
typedef enum objc_ivar_visibility_kind {
OBJC_IVAR_VIS_PROTECTED = 0,
@@ -1040,10 +1036,10 @@ extern tree objc_generate_static_init_call (tree);
extern tree objc_generate_write_barrier (tree, enum tree_code, tree);
extern void objc_set_method_opt (bool);
extern void objc_finish_foreach_loop (location_t, tree, tree, tree, tree, tree);
-extern void objc_set_property_attr
- (location_t, objc_property_attribute_kind, tree);
extern bool objc_method_decl (enum tree_code);
-extern void objc_add_property_declaration (location_t, tree);
+extern void objc_add_property_declaration (location_t, tree, bool, bool, bool,
+ bool, bool, bool, tree, tree,
+ bool, tree);
extern tree objc_build_getter_call (tree, tree);
extern tree objc_build_setter_call (tree, tree);
extern void objc_add_synthesize_declaration (location_t, tree);
diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c
index fb92c7fc0bb..d4a4e58785a 100644
--- a/gcc/c-family/stub-objc.c
+++ b/gcc/c-family/stub-objc.c
@@ -324,14 +324,18 @@ objc_get_class_ivars (tree ARG_UNUSED (name))
}
void
-objc_set_property_attr (location_t ARG_UNUSED (loc),
- objc_property_attribute_kind ARG_UNUSED (code),
- tree ARG_UNUSED (identifier))
-{
-}
-
-void
-objc_add_property_declaration (location_t ARG_UNUSED (loc), tree ARG_UNUSED (prop))
+objc_add_property_declaration (location_t ARG_UNUSED (location),
+ tree ARG_UNUSED (decl),
+ bool ARG_UNUSED (parsed_property_readonly),
+ bool ARG_UNUSED (parsed_property_readwrite),
+ bool ARG_UNUSED (parsed_property_assign),
+ bool ARG_UNUSED (parsed_property_retain),
+ bool ARG_UNUSED (parsed_property_copy),
+ bool ARG_UNUSED (parsed_property_nonatomic),
+ tree ARG_UNUSED (parsed_property_getter_ident),
+ tree ARG_UNUSED (parsed_property_setter_ident),
+ bool ARG_UNUSED (parsed_property_copies),
+ tree ARG_UNUSED (parsed_property_ivar_ident))
{
}