diff options
author | Iain Sandoe <iains@gcc.gnu.org> | 2010-10-17 13:02:07 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2010-10-17 13:02:07 +0000 |
commit | c37d8c307c43a58b602a40b9f6ba19caac77b00a (patch) | |
tree | 4cf60cd36ea1bba58842294fad70214ca02f74bc /gcc/c-parser.c | |
parent | 1501d0941a5d845d923b30c6199ce0f8b792bdc8 (diff) | |
download | gcc-c37d8c307c43a58b602a40b9f6ba19caac77b00a.zip gcc-c37d8c307c43a58b602a40b9f6ba19caac77b00a.tar.gz gcc-c37d8c307c43a58b602a40b9f6ba19caac77b00a.tar.bz2 |
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.
From-SVN: r165585
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 36ed951..e4230b9 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -6703,19 +6703,25 @@ c_parser_objc_class_instance_variables (c_parser *parser) if (c_parser_next_token_is_keyword (parser, RID_AT_PRIVATE)) { c_parser_consume_token (parser); - objc_set_visibility (2); + objc_set_visibility (OBJC_IVAR_VIS_PRIVATE); continue; } else if (c_parser_next_token_is_keyword (parser, RID_AT_PROTECTED)) { c_parser_consume_token (parser); - objc_set_visibility (0); + objc_set_visibility (OBJC_IVAR_VIS_PROTECTED); continue; } else if (c_parser_next_token_is_keyword (parser, RID_AT_PUBLIC)) { c_parser_consume_token (parser); - objc_set_visibility (1); + objc_set_visibility (OBJC_IVAR_VIS_PUBLIC); + continue; + } + else if (c_parser_next_token_is_keyword (parser, RID_AT_PACKAGE)) + { + c_parser_consume_token (parser); + objc_set_visibility (OBJC_IVAR_VIS_PACKAGE); continue; } else if (c_parser_next_token_is (parser, CPP_PRAGMA)) |