Commit c59633d9 by Nicola Pero Committed by Nicola Pero

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
parent b1430e5c
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> 2011-04-14 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (sse4_1): New mode attribute. * config/i386/sse.md (sse4_1): New mode attribute.
......
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> 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. * stub-objc.c (objc_declare_class): Updated argument name.
2011-04-12 Nathan Froyd <froydnj@codesourcery.com> 2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
......
...@@ -52,7 +52,7 @@ extern int objc_is_public (tree, tree); ...@@ -52,7 +52,7 @@ extern int objc_is_public (tree, tree);
extern tree objc_is_id (tree); extern tree objc_is_id (tree);
extern void objc_declare_alias (tree, tree); extern void objc_declare_alias (tree, tree);
extern void objc_declare_class (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_build_message_expr (tree, tree);
extern tree objc_finish_message_expr (tree, tree, tree, tree*); extern tree objc_finish_message_expr (tree, tree, tree, tree*);
extern tree objc_build_selector_expr (location_t, tree); extern tree objc_build_selector_expr (location_t, tree);
......
...@@ -115,7 +115,7 @@ objc_declare_class (tree ARG_UNUSED (identifier)) ...@@ -115,7 +115,7 @@ objc_declare_class (tree ARG_UNUSED (identifier))
} }
void void
objc_declare_protocols (tree ARG_UNUSED (list), tree ARG_UNUSED (attributes)) objc_declare_protocol (tree ARG_UNUSED (name), tree ARG_UNUSED (attributes))
{ {
} }
......
...@@ -7076,7 +7076,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) ...@@ -7076,7 +7076,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes)
if (c_parser_peek_2nd_token (parser)->type == CPP_COMMA if (c_parser_peek_2nd_token (parser)->type == CPP_COMMA
|| c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON) || c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON)
{ {
tree list = NULL_TREE;
/* Any identifiers, including those declared as type names, are /* Any identifiers, including those declared as type names, are
OK here. */ OK here. */
while (true) while (true)
...@@ -7088,7 +7087,7 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) ...@@ -7088,7 +7087,7 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes)
break; break;
} }
id = c_parser_peek_token (parser)->value; 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); c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_COMMA)) if (c_parser_next_token_is (parser, CPP_COMMA))
c_parser_consume_token (parser); c_parser_consume_token (parser);
...@@ -7096,7 +7095,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes) ...@@ -7096,7 +7095,6 @@ c_parser_objc_protocol_definition (c_parser *parser, tree attributes)
break; break;
} }
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
objc_declare_protocols (list, attributes);
} }
else else
{ {
......
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> 2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
PR objc++/48479 PR objc++/48479
......
...@@ -22319,7 +22319,8 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes) ...@@ -22319,7 +22319,8 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes)
{ {
tok = cp_lexer_peek_token (parser->lexer); tok = cp_lexer_peek_token (parser->lexer);
error_at (tok->location, "identifier expected after %<@protocol%>"); 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. */ /* See if we have a forward declaration or a definition. */
...@@ -22328,9 +22329,21 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes) ...@@ -22328,9 +22329,21 @@ cp_parser_objc_protocol_declaration (cp_parser* parser, tree attributes)
/* Try a forward declaration first. */ /* Try a forward declaration first. */
if (tok->type == CPP_COMMA || tok->type == CPP_SEMICOLON) if (tok->type == CPP_COMMA || tok->type == CPP_SEMICOLON)
{ {
objc_declare_protocols (cp_parser_objc_identifier_list (parser), while (true)
attributes); {
finish: 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); cp_parser_consume_semicolon_at_end_of_statement (parser);
} }
......
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> 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 * objc-act.c (objc_declare_class): Changed to take a single
identifier as argument instead of a tree list. This means callers identifier as argument instead of a tree list. This means callers
don't have to build temporary tree lists to call this function. don't have to build temporary tree lists to call this function.
......
...@@ -7863,9 +7863,8 @@ lookup_protocol (tree ident, bool warn_if_deprecated, bool definition_required) ...@@ -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. */ they are already declared or defined, the function has no effect. */
void void
objc_declare_protocols (tree names, tree attributes) objc_declare_protocol (tree name, tree attributes)
{ {
tree list;
bool deprecated = false; bool deprecated = false;
#ifdef OBJCPLUS #ifdef OBJCPLUS
...@@ -7890,10 +7889,6 @@ objc_declare_protocols (tree names, tree attributes) ...@@ -7890,10 +7889,6 @@ objc_declare_protocols (tree names, tree attributes)
} }
} }
for (list = names; list; list = TREE_CHAIN (list))
{
tree name = TREE_VALUE (list);
if (lookup_protocol (name, /* warn if deprecated */ false, if (lookup_protocol (name, /* warn if deprecated */ false,
/* definition_required */ false) == NULL_TREE) /* definition_required */ false) == NULL_TREE)
{ {
...@@ -7909,12 +7904,12 @@ objc_declare_protocols (tree names, tree attributes) ...@@ -7909,12 +7904,12 @@ objc_declare_protocols (tree names, tree attributes)
if (attributes) if (attributes)
{ {
/* TODO: Do we need to store the attributes here ? */
TYPE_ATTRIBUTES (protocol) = attributes; TYPE_ATTRIBUTES (protocol) = attributes;
if (deprecated) if (deprecated)
TREE_DEPRECATED (protocol) = 1; TREE_DEPRECATED (protocol) = 1;
} }
} }
}
} }
static tree static tree
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment