I have a couple of questions:
On Wednesday, Aug 28, 2002, at 11:24 US/Pacific, Stan Shebs wrote:
> shebs 02/08/28 11:23:32
>
> Modified: gcc c-parse.in
> gcc/cp cp-parse.in
> gcc/objc objc-act.c objc-act.h
> Log:
> Fix ObjC crash in the testsuite.
>
> Revision Changes Path
> 1.45 +1 -1 gcc3/gcc/c-parse.in
>
> Index: c-parse.in
> ===================================================================
> RCS file: /cvs/Darwin/gcc3/gcc/c-parse.in,v
> retrieving revision 1.44
> retrieving revision 1.45
> diff -u -r1.44 -r1.45
> --- c-parse.in 2002/08/26 05:39:28 1.44
> +++ c-parse.in 2002/08/28 18:23:30 1.45
> @@ -1884,7 +1884,7 @@
> /* foo(sizeof(struct{ @defs(ClassName)})); */
> | DEFS '(' CLASSNAME ')'
> /* APPLE LOCAL Objective-C++ */
> - { $$ = get_class_ivars ($3); }
> + { $$ = get_class_ivars_from_name ($3); }
We can do this, but perhaps it would be simpler if we checked for
the existence of the class inside of 'get_class_ivars' ?
> Index: cp-parse.in
> ===================================================================
> RCS file: /cvs/Darwin/gcc3/gcc/cp/cp-parse.in,v
> retrieving revision 1.19
> retrieving revision 1.20
> diff -u -r1.19 -r1.20
> --- cp-parse.in 2002/08/26 20:08:07 1.19
> +++ cp-parse.in 2002/08/28 18:23:31 1.20
> @@ -2752,15 +2752,13 @@
> ifobjcp
> /* ObjC @defs(class) construct. */
> | DEFS '(' identifier ')'
> - { objcp_get_class_ivars ($3); }
> + { get_class_ivars_from_name ($3); }
Ditto.
> +/* APPLE LOCAL begin Objective-C++ */
> +/* Implement @defs (<classname>) within struct bodies. */
> +tree
> +get_class_ivars_from_name (class_name)
> + tree class_name;
> +{
> + tree interface = lookup_interface (class_name);
> +
> + if (interface)
> + return get_class_ivars (interface);
> + else
> + {
> + error ("cannot find interface declaration for `%s'",
> + IDENTIFIER_POINTER (class_name));
> + return NULL;
> + }
> +}
> +/* APPLE LOCAL end Objective-C++ */
> +
Probably not needed (see above).
> /* Used by: build_private_template, continue_class,
> and for @defs constructs. */
>
> @@ -4075,8 +4094,7 @@
> else
> UOBJC_CLASS_VARIABLES_decl = 0;
>
> - /* APPLE LOCAL bitfield alignment */
> - chain = CLASS_OWN_IVARS (implementation_template);
> + chain = CLASS_IVARS (implementation_template);
Are you sure this is correct? I'm not sure that it's not :-(, so
I'll take a closer look at the sources before I talk.
--Zem
--------------------------------------------------------------
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