]> gcc.gnu.org Git - gcc.git/commit - gcc/c/ChangeLog
Rename attribute-related functions and productions in C parser.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 15 Oct 2019 00:12:49 +0000 (01:12 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 15 Oct 2019 00:12:49 +0000 (01:12 +0100)
commit783bfe5ee838afc44f8f2125be624788ebe0723b
tree77e549c2cb36410ab587209edb830ed0563e3536
parent490d1b4a834897e927d58d1a8fba93c2a33172df
Rename attribute-related functions and productions in C parser.

The C2x attribute syntax, [[ ]], appears in different places in the
syntax from GNU __attribute__, and, where they can appear in the same
place in the syntax, they do not always appertain to the same entity.
(For example, in "int func(void) ATTRS;", GNU attributes appertain to
the declaration but C2x attributes appertain to the function type.)

Thus, the C parser needs to handle the two kinds of attributes
separately, with each place in the syntax accepting whatever kinds of
attributes are appropriate there and applying them to the relevant
entities.  This patch prepares for this by renaming parser functions
relating to attributes to make clear they are specifically about GNU
attributes and renaming syntax productions likewise to avoid confusing
with the C2x attributes syntax productions.

Where comments refer to attributes, this has only be changed where it
is clear that in the context they are referring specifically to the
gnu-attributes syntax.  There may be other places that also end up
changing to refer to gnu-attributes as part of the C2x attributes
implementation, if more detailed examination of those places shows
they are also specific to gnu-attributes.  (I do not expect code
dealing with semantics of attributes outside of the parser to need to
change; as for C++, it will be possible to use existing attributes
inside [[]] with the gnu:: form of the attribute name.)

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

* c-parser.c (c_parser_attribute_any_word): Rename to
c_parser_gnu_attribute_any_word.  All callers changed.
(c_parser_attribute): Rename to c_parser_gnu_attribute.  All
callers changed.
(c_parser_attributes): Rename to c_parser_gnu_attributes.  All
callers changed.
(c_parser_declaration_or_fndef, c_parser_declspecs)
(c_parser_enum_specifier, c_parser_struct_or_union_specifier)
(c_parser_struct_declaration, c_parser_declarator)
(c_parser_gnu_attribute, c_parser_compound_statement)
(c_parser_label, c_parser_statement, c_parser_objc_method_decl)
(c_parser_transaction_attributes): Add "gnu-" prefix to names of
attribute-related syntax productions.

From-SVN: r276978
gcc/c/ChangeLog
gcc/c/c-parser.c
This page took 0.059297 seconds and 5 git commands to generate.