diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-01 22:54:35 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-01 22:54:35 +0000 |
commit | 8c582e4f6508e1a67855f0e5b4f1cb173b1640cf (patch) | |
tree | 9e084aedbf6e31a6763dd3a170066bbe479e30e6 /gcc/c-family | |
parent | f42bd93b9ce14540164fa99c4a675197987d9acd (diff) | |
download | gcc-8c582e4f6508e1a67855f0e5b4f1cb173b1640cf.tar.gz |
In gcc/c-family/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* c-common.c (handle_noreturn_attribute): Recognize 'noreturn'
attribute for Objective-C methods.
In gcc/objc/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* objc-act.c (objc_start_method_definition): If method attributes
are specified emit a warning and ignore them.
(build_objc_method_call): Moved deprecation warnings from here ...
(objc_finish_message_expr): to here. Do not emit deprecation
warnings if the receiver is of type 'id'.
(really_start_method): Install 'deprecation' and 'noreturn'
attributes.
(objc_decl_method_attributes): Carefully filter out the list of
attributes, allowing only "noreturn", "format", "sentinel" and
"deprecated". In the case of "format", adjust the arguments.
Always process the attributes in the same way no matter if
"sentinel" is in the list or not.
In gcc/testsuite/:
2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented format and noreturn attributes for Objective-C methods.
* objc.dg/attributes/method-attribute-2.m: Updated warnings.
* objc.dg/attributes/method-deprecated-1.m: New.
* objc.dg/attributes/method-deprecated-2.m: New.
* objc.dg/attributes/method-deprecated-3.m: New.
* objc.dg/attributes/method-noreturn-1.m: New.
* objc.dg/attributes/method-sentinel-1.m: New.
* objc.dg/attributes/method-format-1.m: New.
* obj-c++.dg/attributes/method-attribute-2.mm: Updated warnings.
* obj-c++.dg/attributes/method-deprecated-1.mm: New.
* obj-c++.dg/attributes/method-deprecated-2.mm: New.
* obj-c++.dg/attributes/method-deprecated-3.mm: New.
* obj-c++.dg/attributes/method-noreturn-1.mm: New.
* obj-c++.dg/attributes/method-sentinel-1.mm: New.
* obj-c++.dg/attributes/method-format-1.mm: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index cb5b5dc475b..b2c90110fef 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2010-11-01 Nicola Pero <nicola.pero@meta-innovation.com> + + Implemented format and noreturn attributes for Objective-C methods. + * c-common.c (handle_noreturn_attribute): Recognize 'noreturn' + attribute for Objective-C methods. + 2010-10-31 Jason Merrill <jason@redhat.com> * c-common.c (conversion_warning, warn_for_collisions_1): Use diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 923c63afa13..ab050ab2e68 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5729,7 +5729,8 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args), tree type = TREE_TYPE (*node); /* See FIXME comment in c_common_attribute_table. */ - if (TREE_CODE (*node) == FUNCTION_DECL) + if (TREE_CODE (*node) == FUNCTION_DECL + || objc_method_decl (TREE_CODE (*node))) TREE_THIS_VOLATILE (*node) = 1; else if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE) |