From 40c8d1dd9270673b786230c1a649fd5a12641562 Mon Sep 17 00:00:00 2001 From: iains Date: Wed, 13 Oct 2010 08:24:48 +0000 Subject: implement method attributes. gcc/c-family: merge from FSF apple 'trunk' branch. 2006-04-26 Fariborz Jahanian Radar 3803157 (method attributes) * c-common.c (handle_deprecated_attribute): Recognize objc methods as valid declarations. * c-common.h: Declare objc_method_decl (). * stub-objc.c (objc_method_decl): New stub. gcc/objc: merge from FSF apple 'trunk' branch. 2006-04-26 Fariborz Jahanian Radar 3803157 (method attributes) * objc/objc-act.h (METHOD_TYPE_ATTRIBUTES): New macro. * objc/objc-act.c (objc_decl_method_attributes): New. (objc_add_method_declaration): Process method's attribute. (objc_start_method_definition): Ditto. (build_objc_method_call): Inject method attribute into built function type. (objc_method_decl): New. (objc_warn_deprecated)use): New. testsuite: * objc.dg/attributes/method-attribute-1.m: Update to respond to implemented method attributes.. * objc.dg/attributes/method-attribute-2.m: Likewise. * objc.dg/attributes/method-attribute-3.m: Likewise. * obj-c++.dg/attributes/method-attribute-1.mm: Likewise. * obj-c++.dg/attributes/method-attribute-2.mm: Likewise. * obj-c++.dg/attributes/method-attribute-3.mm: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165415 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-family/ChangeLog | 11 +++++++++++ gcc/c-family/c-common.c | 3 ++- gcc/c-family/c-common.h | 1 + gcc/c-family/stub-objc.c | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) (limited to 'gcc/c-family') diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 77908955dfb..dde5c45eb4f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,14 @@ +2010-10-13 Iain Sandoe + + merge from FSF apple 'trunk' branch. + 2006-04-26 Fariborz Jahanian + + Radar 3803157 (method attributes) + * c-common.c (handle_deprecated_attribute): Recognize + objc methods as valid declarations. + * c-common.h: Declare objc_method_decl (). + * stub-objc.c (objc_method_decl): New stub. + 2010-10-08 Joseph Myers * c-common.c (parse_optimize_options): Call diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index ff3526b03c3..49eb5106f63 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7189,7 +7189,8 @@ handle_deprecated_attribute (tree *node, tree name, || TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == FIELD_DECL) + || TREE_CODE (decl) == FIELD_DECL + || objc_method_decl (TREE_CODE (decl))) TREE_DEPRECATED (decl) = 1; else warn = 1; diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 3236e856a09..71efaf955da 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -1009,6 +1009,7 @@ 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 bool objc_method_decl (enum tree_code); /* The following are provided by the C and C++ front-ends, and called by ObjC/ObjC++. */ diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c index 52675840d99..6b8c33457ea 100644 --- a/gcc/c-family/stub-objc.c +++ b/gcc/c-family/stub-objc.c @@ -217,6 +217,12 @@ objc_finish_method_definition (tree ARG_UNUSED (fndecl)) { } +bool +objc_method_decl (enum tree_code ARG_UNUSED(opcode)) +{ + return false; +} + tree objc_build_keyword_decl (tree ARG_UNUSED (selector), tree ARG_UNUSED (type), -- cgit v1.2.1