From c59633d9da23d48847f3b1bc8f14772beffb1435 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Thu, 14 Apr 2011 19:34:06 +0000 Subject: In gcc/c-family/: 2011-04-14 Nicola Pero In gcc/c-family/: 2011-04-14 Nicola Pero * stub-objc.c (objc_declare_protocols): Renamed to objc_declare_protocol. * c-objc.h: Likewise. In gcc/: 2011-04-14 Nicola Pero * 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 * 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 * parser.c (cp_parser_objc_protocol_declaration): Updated for change from objc_declare_protocols() to objc_declare_protocol(). From-SVN: r172444 --- gcc/objc/ChangeLog | 7 +++++++ gcc/objc/objc-act.c | 41 ++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) (limited to 'gcc/objc') 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 + * 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 + * 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; } } } -- cgit v1.1