diff options
author | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-28 21:02:38 +0000 |
---|---|---|
committer | iains <iains@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-28 21:02:38 +0000 |
commit | 03fc2271198493dcf1377e49f603aa9e004eb642 (patch) | |
tree | 0b58ec78878b5ec817b8d9d6545ff6e30a03c52c /gcc/c-family | |
parent | cc7d6aed6b7186313ada1a58107b9dbcaac2f435 (diff) | |
download | gcc-03fc2271198493dcf1377e49f603aa9e004eb642.tar.gz |
add parsing for ObjC* method & method parm attributes
gcc/cp:
Partially merged from apple/trunk branch on FSF servers:
2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
Radar 3803157 (method attributes)
* parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
(cp_parser_objc_method_tail_params_opt): Likewise.
(cp_parser_objc_method_signature): Likewise.
(cp_parser_objc_method_maybe_bad_prefix_attributes): New.
(cp_parser_objc_method_prototype_list): Handle attributes.
(cp_parser_objc_method_definition_list): Likewise.
gcc/objc:
* objc-act.c (objc_add_method_declaration): Handle attributes.
(objc_start_method_definition): Likewise.
(objc_generate_cxx_ctor_or_dtor): Pass NULL attributes to ctor/dtor.
(objc_build_keyword_decl): Handle attributes.
gcc:
* c-parser.c (c_parser_declaration_or_fndef): Diagnose incorrect prefix
attributes on methods.
(c_parser_objc_method_definition): Handle attributes.
(c_parser_objc_methodproto): Likewise.
(c_parser_objc_maybe_method_attributes): New.
(c_parser_objc_method_decl): Handle attributes, add a similar diagnostic
to ObjC++ for a missing definition.
gcc/c-family:
* c-common.h: Update declarations to include attributes.
* stub-objc.c: Likewise.
testsuite:
* objc.dg/attributes/method-attribute-1.m: New.
* objc.dg/attributes/method-attribute-2.m: New.
* obj-c++.dg/attributes/method-attribute-1.m: New.
* obj-c++.dg/attributes/method-attribute-2.m: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/c-family/c-common.h | 6 | ||||
-rw-r--r-- | gcc/c-family/stub-objc.c | 9 |
3 files changed, 19 insertions, 6 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index b3687d8c71c..7480f63f321 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,15 @@ 2010-09-28 Iain Sandoe <iains@gcc.gnu.org> + * c-common.h (objc_add_method_declaration): Adjust prototype to + include attributes. + (objc_start_method_definition): Likewise. + (objc_build_keyword_decl): Likewise. + * stub-objc.c:(objc_add_method_declaration): Handle attributes. + (objc_start_method_definition): Likewise. + (objc_build_keyword_decl): Likewise. + +2010-09-28 Iain Sandoe <iains@gcc.gnu.org> + * c-common.h (objc_start_class_interface): Adjust prototype. (objc_start_category_interface): Likewise. (objc_start_protocol): Likewise. diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 99efe84906d..45ec999745e 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -977,11 +977,11 @@ extern void objc_finish_implementation (void); extern void objc_set_visibility (int); 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); -extern bool objc_start_method_definition (tree); +extern void objc_add_method_declaration (tree, tree); +extern bool objc_start_method_definition (tree, tree); extern void objc_finish_method_definition (tree); extern void objc_add_instance_variable (tree); -extern tree objc_build_keyword_decl (tree, tree, tree); +extern tree objc_build_keyword_decl (tree, tree, tree, tree); extern tree objc_build_throw_stmt (location_t, tree); extern void objc_begin_try_stmt (location_t, tree); extern tree objc_finish_try_stmt (void); diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c index 83472bef1d1..6e205bfb178 100644 --- a/gcc/c-family/stub-objc.c +++ b/gcc/c-family/stub-objc.c @@ -196,12 +196,14 @@ objc_finish_implementation (void) } void -objc_add_method_declaration (tree ARG_UNUSED (signature)) +objc_add_method_declaration (tree ARG_UNUSED (signature), + tree ARG_UNUSED (attributes)) { } bool -objc_start_method_definition (tree ARG_UNUSED (signature)) +objc_start_method_definition (tree ARG_UNUSED (signature), + tree ARG_UNUSED (attributes)) { return true; } @@ -214,7 +216,8 @@ objc_finish_method_definition (tree ARG_UNUSED (fndecl)) tree objc_build_keyword_decl (tree ARG_UNUSED (selector), tree ARG_UNUSED (type), - tree ARG_UNUSED (identifier)) + tree ARG_UNUSED (identifier), + tree ARG_UNUSED (attributes)) { return 0; } |