aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2011-04-14 19:34:06 +0000
committerNicola Pero <nicola@gcc.gnu.org>2011-04-14 19:34:06 +0000
commitc59633d9da23d48847f3b1bc8f14772beffb1435 (patch)
tree818b891498592f8fd53a22155014ee9695ac26a9 /gcc/objc
parentb1430e5cf832e7d5bfbfa76998c4236be21867d1 (diff)
downloadgcc-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/objc')
-rw-r--r--gcc/objc/ChangeLog7
-rw-r--r--gcc/objc/objc-act.c41
2 files changed, 25 insertions, 23 deletions
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;
}
}
}