[Patch, ObjC/C++ V2, Part1] Recognize attributes on class, category and protocol declarations.
IainS
developer@sandoe-acoustics.co.uk
Tue Sep 28 20:51:00 GMT 2010
Mike,
I will note that, whilst the patch touches gcc/ gcc/c-family gcc/cp
and gcc/objc, it *only* touches objc-specific routines or code paths.
Ergo, as per Nicola's relayed email from Joseph, it is eligible for
your review, if you would have time.
(of course, I would welcome comments from any reviewer).
This is a re-issue of this patch that takes into account:
(a) Nicola's comment on the diagnostics strings
(b) makes some small stylistic changes (naming routines more
consistently)
(c) factors a test out that is needed in several places (and by method
attribs in part 2)
(d) Splits the patch into code & test-suite sections.
tested on i686-darwin9, x86_64-linux and a cross to cris-elf
OK for trunk?
Iain
On 26 Sep 2010, at 15:04, IainS wrote:
>
> 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.
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 164686-objc-attr-1a.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100928/ac6d7228/attachment.txt>
-------------- next part --------------
> 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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 164686-objc-attr-tests.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100928/ac6d7228/attachment-0001.txt>
-------------- next part --------------
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 164686-obj-c++-attr-tests.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100928/ac6d7228/attachment-0002.txt>
-------------- next part --------------
More information about the Gcc-patches
mailing list