diff options
author | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-17 13:02:07 +0000 |
---|---|---|
committer | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-17 13:02:07 +0000 |
commit | 4a8875ed04bdb950589f3bdd2ddbb69fc910f94a (patch) | |
tree | 4cf60cd36ea1bba58842294fad70214ca02f74bc /gcc/c-family | |
parent | 8e03fb20974e43b5302f7c4f3548b3bf41352e25 (diff) | |
download | gcc-4a8875ed04bdb950589f3bdd2ddbb69fc910f94a.tar.gz |
add parse support for @package to ObjC*
gcc/c-family:
* c-common.c (c_common_reswords): Add package, RID_AT_PACKAGE.
* c-common.h (enum rid): Add RID_AT_PACKAGE.
(objc_ivar_visibility_kind): New enum.
(objc_set_visibility): Adjust prototype to use visibility enum.
* stub-objc.c (objc_set_visibility): Adjust stub to use
visibility enum.
gcc/objc:
* objc-act.c: Rename 'objc_public_flag' to objc_ivar_visibility and
make its type 'objc_ivar_visibility_kind'.
(objc_start_class_interface): Update to use visibility enum.
(objc_start_class_implementation): Likewise.
(objc_set_visibility): Update to use visibility enum, warn that
@package is handle as per @public.
(add_instance_variable): Handle OBJC_IVAR_VIS_PACKAGE.
* objc-act.h: Rename 'objc_public_flag' to objc_ivar_visibility and
make its type 'objc_ivar_visibility_kind'.
gcc/cp:
* parser.c (cp_parser_objc_visibility_spec): Update to use visibility
enum, and handle @package.
gcc:
* c-parser.c (c_parser_objc_class_instance_variables): Update to use
visibility enum, and handle @package.
gcc/testsuite:
* objc.dg/fsf-package-0.m: New.
* obj-c++.dg/fsf-package-0.m: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 1 | ||||
-rw-r--r-- | gcc/c-family/c-common.h | 12 | ||||
-rw-r--r-- | gcc/c-family/stub-objc.c | 2 |
4 files changed, 21 insertions, 3 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 29fc3a1e37d..f0ef49e0171 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,12 @@ +2010-10-17 Iain Sandoe <iains@gcc.gnu.org> + + * c-common.c (c_common_reswords): Add package, RID_AT_PACKAGE. + * c-common.h (enum rid): Add RID_AT_PACKAGE. + (objc_ivar_visibility_kind): New enum. + (objc_set_visibility): Adjust prototype to use visibility enum. + * stub-objc.c (objc_set_visibility): Adjust stub to use + visibility enum. + 2010-10-14 Michael Meissner <meissner@linux.vnet.ibm.com> * c-cppbuiltin.c (builtin_define_float_constants): Emit diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 5203c0538ee..5068c56f5ed 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -544,6 +544,7 @@ const struct c_common_resword c_common_reswords[] = { "optional", RID_AT_OPTIONAL, D_OBJC }, { "required", RID_AT_REQUIRED, D_OBJC }, { "property", RID_AT_PROPERTY, D_OBJC }, + { "package", RID_AT_PACKAGE, D_OBJC }, /* These are recognized only in protocol-qualifier context (see above) */ { "bycopy", RID_BYCOPY, D_OBJC }, diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 8c79d27d9dd..8855ff794d3 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -143,7 +143,7 @@ enum rid they follow '@') */ RID_AT_ENCODE, RID_AT_END, RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS, - RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, + RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, RID_AT_PACKAGE, RID_AT_PROTOCOL, RID_AT_SELECTOR, RID_AT_THROW, RID_AT_TRY, RID_AT_CATCH, RID_AT_FINALLY, RID_AT_SYNCHRONIZED, @@ -440,6 +440,14 @@ typedef enum objc_property_attribute_kind { OBJC_PATTR_COPIES = 5 } objc_property_attribute_kind; +/* ObjC ivar visibility types. */ +typedef enum objc_ivar_visibility_kind { + OBJC_IVAR_VIS_PROTECTED = 0, + OBJC_IVAR_VIS_PUBLIC = 1, + OBJC_IVAR_VIS_PRIVATE = 2, + OBJC_IVAR_VIS_PACKAGE = 3 +} objc_ivar_visibility_kind; + /* The various name of operator that appears in error messages. */ typedef enum ref_operator { /* NULL */ @@ -1009,7 +1017,7 @@ extern void objc_start_class_implementation (tree, tree); extern void objc_start_category_implementation (tree, tree); extern void objc_continue_implementation (void); extern void objc_finish_implementation (void); -extern void objc_set_visibility (int); +extern void objc_set_visibility (objc_ivar_visibility_kind); extern void objc_set_method_type (enum tree_code); extern tree objc_build_method_signature (tree, tree, tree, bool); extern void objc_add_method_declaration (tree, tree); diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c index 4a8a2b56b8e..cff4d79267e 100644 --- a/gcc/c-family/stub-objc.c +++ b/gcc/c-family/stub-objc.c @@ -163,7 +163,7 @@ objc_add_instance_variable (tree ARG_UNUSED (decl)) } void -objc_set_visibility (int ARG_UNUSED (vis)) +objc_set_visibility (objc_ivar_visibility_kind ARG_UNUSED (vis)) { } |