This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: ObjC fix typed selector duplication
- From: Nicola Pero <nicola at brainstorm dot co dot uk>
- To: shebs at apple dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, Alexander Malmberg <alexander at malmberg dot org>
- Date: Wed, 3 Jul 2002 13:54:10 +0100 (BST)
- Subject: RFA: ObjC fix typed selector duplication
I'd like to apply alex's patch to reduce selector bloating in the GNU
runtime, submitted as part of PR/5956.
It fixes a (trivial) typo which causes duplicated selectors to be inserted
into the object code - for the GNU runtime only.
[I've also replaced 'proto' with 'prototype' (a shy attempt at increasing
a little the code readability)].
Tested on i686-pc-linux-gnu, no regressions; fixes PR/5956.
Ok to commit to head ?
Wed Jul 3 14:38:12 2002 Nicola Pero <n.pero@mi.flashnet.it>
PR/5956:
* objc/objc-act.c (build_typed_selector_reference): Fix typo which
was causing the new selector never to match the existing ones
(Patch by Alexander Malmberg <alexander@malmberg.org>).
Index: objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.141
diff -u -r1.141 objc-act.c
--- objc-act.c 2 Jul 2002 23:06:02 -0000 1.141
+++ objc-act.c 3 Jul 2002 12:36:07 -0000
@@ -2043,8 +2043,8 @@
identifier_node that represent the selector. */
static tree
-build_typed_selector_reference (ident, proto)
- tree ident, proto;
+build_typed_selector_reference (ident, prototype)
+ tree ident, prototype;
{
tree *chain = &sel_ref_chain;
tree expr;
@@ -2052,14 +2052,14 @@
while (*chain)
{
- if (TREE_PURPOSE (*chain) == ident && TREE_VALUE (*chain) == proto)
+ if (TREE_PURPOSE (*chain) == prototype && TREE_VALUE (*chain) == ident)
goto return_at_index;
index++;
chain = &TREE_CHAIN (*chain);
}
- *chain = tree_cons (proto, ident, NULL_TREE);
+ *chain = tree_cons (prototype, ident, NULL_TREE);
return_at_index:
expr = build_unary_op (ADDR_EXPR,