diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2011-04-14 19:34:06 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2011-04-14 19:34:06 +0000 |
commit | c59633d9da23d48847f3b1bc8f14772beffb1435 (patch) | |
tree | 818b891498592f8fd53a22155014ee9695ac26a9 /gcc | |
parent | b1430e5cf832e7d5bfbfa76998c4236be21867d1 (diff) | |
download | gcc-c59633d9da23d48847f3b1bc8f14772beffb1435.zip gcc-c59633d9da23d48847f3b1bc8f14772beffb1435.tar.gz gcc-c59633d9da23d48847f3b1bc8f14772beffb1435.tar.bz2 |
In gcc/c-family/: 2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/c-family/:
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* stub-objc.c (objc_declare_protocols): Renamed to
objc_declare_protocol.
* c-objc.h: Likewise.
In gcc/:
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_protocol_definition): Updated for
change from objc_declare_protocols() to objc_declare_protocol().
In gcc/objc/:
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_declare_protocols): Renamed to
objc_declare_protocol. Changed first argument to be an identifier
instead of a tree chain of identifiers, so that callers don't have
to create a temporary tree chain.
In gcc/cp/:
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_protocol_declaration): Updated for
change from objc_declare_protocols() to objc_declare_protocol().
From-SVN: r172444
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-objc.h | 2 | ||||
-rw-r--r-- | gcc/c-family/stub-objc.c | 2 | ||||
-rw-r--r-- | gcc/c-parser.c | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 21 | ||||
-rw-r--r-- | gcc/objc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 41 |
9 files changed, 61 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 010f781..b60fdbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + + * c-parser.c (c_parser_objc_protocol_definition): Updated for + change from objc_declare_protocols() to objc_declare_protocol(). + 2011-04-14 Uros Bizjak <ubizjak@gmail.com> * config/i386/sse.md (sse4_1): New mode attribute. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 4b47474..db96f89 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,11 @@ 2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + * stub-objc.c (objc_declare_protocols): Renamed to + objc_declare_protocol. + * c-objc.h: Likewise. + +2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + * stub-objc.c (objc_declare_class): Updated argument name. 2011-04-12 Nathan Froyd <froydnj@codesourcery.com> diff --git a/gcc/c-family/c-objc.h b/gcc/c-family/c-objc.h index 8f7bd62..08433ae 100644 --- a/gcc/c-family/c-objc.h +++ b/gcc/c-family/c-objc.h @@ -52,7 +52,7 @@ extern int objc_is_public (tree, tree); extern tree objc_is_id (tree); extern void objc_declare_alias (tree, tree); extern void objc_declare_class (tree); -extern void objc_declare_protocols (tree, tree); +extern void objc_declare_protocol (tree, tree); extern tree objc_build_message_expr (tree, tree); extern tree objc_finish_message_expr (tree, tree, tree, tree*); extern tree objc_build_selector_expr (location_t, tree); diff --git a/gcc/c-family/stub-objc.c b/gcc/c-family/stub-objc.c index 6834721..4e235ff 100644 --- a/gcc/c-family/stub-objc.c +++ b/gcc/c-family/stub-objc.c @@ -115,7 +115,7 @@ objc_declare_class (tree ARG_UNUSED (identifier)) } void -objc_declare_protocols (tree ARG_UNUSED (list), tree ARG_UNUSED (attributes)) +objc_declare_protocol (tree ARG_UNUSED (name), tree ARG_UNUSED (attributes)) { } diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 8000b75..b61ebdd 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -7076,7 +7076,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) if (c_parser_peek_2nd_token (parser)->type == CPP_COMMA || c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON) { - tree list = NULL_TREE; /* Any identifiers, including those declared as type names, are OK here. */ while (true) @@ -7088,7 +7087,7 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) break; } id = c_parser_peek_token (parser)->value; - list = chainon (list, build_tree_list (NULL_TREE, id)); + objc_declare_protocol (id, attributes); c_parser_consume_token (parser); if (c_parser_next_token_is (parser, CPP_COMMA)) c_parser_consume_token (parser); @@ -7096,7 +7095,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) break; } c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); - objc_declare_protocols (list, attributes); } else { diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d2d68ec..80c96e1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + + * parser.c (cp_parser_objc_protocol_declaration): Updated for + change from objc_declare_protocols() to objc_declare_protocol(). + 2011-04-14 Nathan Froyd <froydnj@codesourcery.com> PR objc++/48479 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7ffa8ba..ba331ae 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -22319,7 +22319,8 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes) { tok = cp_lexer_peek_token (parser->lexer); error_at (tok->location, "identifier expected after %<@protocol%>"); - goto finish; + cp_parser_consume_semicolon_at_end_of_statement (parser); + return; } /* See if we have a forward declaration or a definition. */ @@ -22328,9 +22329,21 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes) /* Try a forward declaration first. */ if (tok->type == CPP_COMMA || tok->type == CPP_SEMICOLON) { - objc_declare_protocols (cp_parser_objc_identifier_list (parser), - attributes); - finish: + while (true) + { + tree id; + + id = cp_parser_identifier (parser); + if (id == error_mark_node) + break; + + objc_declare_protocol (id, attributes); + + if(cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) + cp_lexer_consume_token (parser->lexer); + else + break; + } cp_parser_consume_semicolon_at_end_of_statement (parser); } diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index f39cb0a..060fc69 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,5 +1,12 @@ 2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + * objc-act.c (objc_declare_protocols): Renamed to + objc_declare_protocol. Changed first argument to be an identifier + instead of a tree chain of identifiers, so that callers don't have + to create a temporary tree chain. + +2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> + * objc-act.c (objc_declare_class): Changed to take a single identifier as argument instead of a tree list. This means callers don't have to build temporary tree lists to call this function. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index c68f628..f75fa75 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -7863,9 +7863,8 @@ lookup_protocol (tree ident, bool warn_if_deprecated, bool definition_required) they are already declared or defined, the function has no effect. */ void -objc_declare_protocols (tree names, tree attributes) +objc_declare_protocol (tree name, tree attributes) { - tree list; bool deprecated = false; #ifdef OBJCPLUS @@ -7890,29 +7889,25 @@ objc_declare_protocols (tree names, tree attributes) } } - for (list = names; list; list = TREE_CHAIN (list)) + if (lookup_protocol (name, /* warn if deprecated */ false, + /* definition_required */ false) == NULL_TREE) { - tree name = TREE_VALUE (list); - - if (lookup_protocol (name, /* warn if deprecated */ false, - /* definition_required */ false) == NULL_TREE) + tree protocol = make_node (PROTOCOL_INTERFACE_TYPE); + + TYPE_LANG_SLOT_1 (protocol) + = make_tree_vec (PROTOCOL_LANG_SLOT_ELTS); + PROTOCOL_NAME (protocol) = name; + PROTOCOL_LIST (protocol) = NULL_TREE; + add_protocol (protocol); + PROTOCOL_DEFINED (protocol) = 0; + PROTOCOL_FORWARD_DECL (protocol) = NULL_TREE; + + if (attributes) { - tree protocol = make_node (PROTOCOL_INTERFACE_TYPE); - - TYPE_LANG_SLOT_1 (protocol) - = make_tree_vec (PROTOCOL_LANG_SLOT_ELTS); - PROTOCOL_NAME (protocol) = name; - PROTOCOL_LIST (protocol) = NULL_TREE; - add_protocol (protocol); - PROTOCOL_DEFINED (protocol) = 0; - PROTOCOL_FORWARD_DECL (protocol) = NULL_TREE; - - if (attributes) - { - TYPE_ATTRIBUTES (protocol) = attributes; - if (deprecated) - TREE_DEPRECATED (protocol) = 1; - } + /* TODO: Do we need to store the attributes here ? */ + TYPE_ATTRIBUTES (protocol) = attributes; + if (deprecated) + TREE_DEPRECATED (protocol) = 1; } } } |