This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[objc] PATCH: further trivial clean-ups
- From: Ziemowit Laski <zlaski at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Oct 2003 17:06:50 -0700
- Subject: [objc] PATCH: further trivial clean-ups
Turns out that 'add_method' collides with a cc1plus function of the
same name. :-(
Also, we were erroneously allowing static N{S,X}ConstantString
instances (as opposed to
compile-time string _literals_, which we should and do allow).
Bootstrapped with no regressions.
2003-10-14 Ziemowit Laski <zlaski@apple.com>
* c-parse.in (methoddef, methodproto): Call objc_add_method()
instead of add_method().
* objc/objc-act.c (objc_check_decl): Do not check for
constant_string_type.
(add_method): Rename to objc_add_method().
(really_start_method): Call objc_add_method() instead of
add_method().
* objc/objc-act.h (add_method): Rename to objc_add_method().
Index: gcc/c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.186
diff -c -3 -p -r1.186 c-parse.in
*** gcc/c-parse.in 2 Oct 2003 00:07:42 -0000 1.186
--- gcc/c-parse.in 14 Oct 2003 23:54:22 -0000
*************** methoddef:
*** 2931,2937 ****
methoddecl
{
objc_pq_context = 0;
! add_method (objc_implementation_context, $3,
objc_inherit_code == CLASS_METHOD_DECL);
start_method_def ($3);
}
optarglist
--- 2931,2939 ----
methoddecl
{
objc_pq_context = 0;
! objc_add_method (objc_implementation_context,
! $3,
! objc_inherit_code ==
CLASS_METHOD_DECL);
start_method_def ($3);
}
optarglist
*************** methodproto:
*** 2969,2975 ****
{
/* Forget protocol qualifiers here. */
objc_pq_context = 0;
! add_method (objc_interface_context, $3,
objc_inherit_code == CLASS_METHOD_DECL);
}
semi_or_error
;
--- 2971,2979 ----
{
/* Forget protocol qualifiers here. */
objc_pq_context = 0;
! objc_add_method (objc_interface_context,
! $3,
! objc_inherit_code ==
CLASS_METHOD_DECL);
}
semi_or_error
;
Index: gcc/objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.200
diff -c -3 -p -r1.200 objc-act.c
*** gcc/objc/objc-act.c 3 Oct 2003 22:49:54 -0000 1.200
--- gcc/objc/objc-act.c 14 Oct 2003 23:54:22 -0000
*************** objc_check_decl (tree decl)
*** 947,956 ****
if (TREE_CODE (type) != RECORD_TYPE)
return;
! if (TYPE_NAME (type) && (type = is_class_name (TYPE_NAME (type)))
! && type != constant_string_type)
error ("statically allocated instance of Objective-C class `%s'",
! IDENTIFIER_POINTER (type));
}
/* Implement static typing. At this point, we know we have an
interface. */
--- 947,955 ----
if (TREE_CODE (type) != RECORD_TYPE)
return;
! if (TYPE_NAME (type) && (type = is_class_name (TYPE_NAME (type))))
error ("statically allocated instance of Objective-C class `%s'",
! IDENTIFIER_POINTER (type));
}
/* Implement static typing. At this point, we know we have an
interface. */
*************** add_method_to_hash_list (hash *hash_list
*** 6300,6306 ****
}
tree
! add_method (tree class, tree method, int is_class)
{
tree mth;
--- 6299,6305 ----
}
tree
! objc_add_method (tree class, tree method, int is_class)
{
tree mth;
*************** really_start_method (tree method, tree p
*** 7815,7822 ****
CLASS_SUPER_NAME
(objc_implementation_context));
if (interface)
! add_method (interface, copy_node (method),
! TREE_CODE (method) == CLASS_METHOD_DECL);
}
}
}
--- 7814,7821 ----
CLASS_SUPER_NAME
(objc_implementation_context));
if (interface)
! objc_add_method (interface, copy_node (method),
! TREE_CODE (method) == CLASS_METHOD_DECL);
}
}
}
Index: gcc/objc/objc-act.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.h,v
retrieving revision 1.19
diff -c -3 -p -r1.19 objc-act.h
*** gcc/objc/objc-act.h 25 Sep 2003 01:25:53 -0000 1.19
--- gcc/objc/objc-act.h 14 Oct 2003 23:54:22 -0000
*************** tree is_ivar (tree, tree);
*** 54,60 ****
int is_private (tree);
int is_public (tree, tree);
tree add_instance_variable (tree, int, tree, tree, tree);
! tree add_method (tree, tree, int);
tree get_super_receiver (void);
void objc_clear_super_receiver (void);
tree get_class_ivars_from_name (tree);
--- 54,60 ----
int is_private (tree);
int is_public (tree, tree);
tree add_instance_variable (tree, int, tree, tree, tree);
! tree objc_add_method (tree, tree, int);
tree get_super_receiver (void);
void objc_clear_super_receiver (void);
tree get_class_ivars_from_name (tree);
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477