From c165dca7efdb3f4bdae82c01b409a6b9cf4dbd65 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Tue, 28 Sep 2010 20:08:38 +0000 Subject: add ObjC* class, category and protocol attribute parsers gcc/c-family: * c-common.h (objc_start_class_interface): Adjust prototype. (objc_start_category_interface): Likewise. (objc_start_protocol): Likewise. * stub-objc.c (objc_start_protocol): Adjust for extra argument. (objc_start_class_interface): Likewise. (objc_start_category_interface): Likewise. gcc/objc: * objc-act.c (objc_start_class_interface): Handle and ignore attributes. (objc_start_category_interface): Likewise. (objc_start_protocol): Likewise. gcc/cp: * parser.c (cp_parser_objc_valid_prefix_attributes): New. (cp_parser_declaration): Parse prefix attributes for ObjC++. (cp_parser_objc_protocol_declaration): Handle attributes. (cp_parser_objc_class_interface): Likewise. (cp_parser_objc_declaration): Likewise. gcc: * c-parser.c (c_parser_objc_class_definition): Adjust prototype. (c_parser_objc_protocol_definition): Likewise. (c_parser_external_declaration): Provide dummy attribute arguments. (c_parser_declaration_or_fndef): Parse prefix attributes for ObjC. (c_parser_objc_class_definition): Handle attributes. (c_parser_objc_protocol_definition): Likewise. gcc/testsuite: * objc.dg/attributes: New. * objc.dg/attributes/attributes.exp: New. * objc.dg/attributes/class-attribute-1.m: New. * objc.dg/attributes/class-attribute-2.m: New * objc.dg/attributes/categ-attribute-1.m: New * objc.dg/attributes/categ-attribute-2.m: New * objc.dg/attributes/proto-attribute-1.m: New * obj-c++.dg/attributes: New. * obj-c++.dg/attributes/attributes.exp: New * obj-c++.dg/attributes/class-attribute-1.mm: New * obj-c++.dg/attributes/class-attribute-2.mm: New * obj-c++.dg/attributes/categ-attribute-1.mm: New * obj-c++.dg/attributes/categ-attribute-2.mm: New * obj-c++.dg/attributes/proto-attribute-1.mm: New From-SVN: r164700 --- gcc/objc/ChangeLog | 6 ++++++ gcc/objc/objc-act.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'gcc/objc') diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 65d61b1..d797283 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2010-09-28 Iain Sandoe + + * objc-act.c (objc_start_class_interface): Handle and ignore attributes. + (objc_start_category_interface): Likewise. + (objc_start_protocol): Likewise. + 2010-09-28 Nicola Pero Merge from 'apple/trunk' branch on FSF servers. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 8e6c683..9401769 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -651,8 +651,13 @@ lookup_protocol_in_reflist (tree rproto_list, tree lproto) } void -objc_start_class_interface (tree klass, tree super_class, tree protos) +objc_start_class_interface (tree klass, tree super_class, + tree protos, tree attributes) { + if (attributes) + warning_at (input_location, OPT_Wattributes, + "class attributes are not available in this version" + " of the compiler, (ignored)"); objc_interface_context = objc_ivar_context = start_class (CLASS_INTERFACE_TYPE, klass, super_class, protos); @@ -660,8 +665,13 @@ objc_start_class_interface (tree klass, tree super_class, tree protos) } void -objc_start_category_interface (tree klass, tree categ, tree protos) +objc_start_category_interface (tree klass, tree categ, + tree protos, tree attributes) { + if (attributes) + warning_at (input_location, OPT_Wattributes, + "category attributes are not available in this version" + " of the compiler, (ignored)"); objc_interface_context = start_class (CATEGORY_INTERFACE_TYPE, klass, categ, protos); objc_ivar_chain @@ -669,8 +679,12 @@ objc_start_category_interface (tree klass, tree categ, tree protos) } void -objc_start_protocol (tree name, tree protos) +objc_start_protocol (tree name, tree protos, tree attributes) { + if (attributes) + warning_at (input_location, OPT_Wattributes, + "protocol attributes are not available in this version" + " of the compiler, (ignored)"); objc_interface_context = start_protocol (PROTOCOL_INTERFACE_TYPE, name, protos); } -- cgit v1.1