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); }
   end ifobjc
        ;
   
  
  
  
  1.20      +2 -4      gcc3/gcc/cp/cp-parse.in
  
  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); }
   end ifobjcp
        ;
   
   access_specifier:
          VISSPEC ':'
  -                {
  -               current_access_specifier = $1;
  -                }
  +                { current_access_specifier = $1; }
        ;
   
   /* Note: we no longer warn about the semicolon after a component_decl_list.
  
  
  
  1.112     +20 -16    gcc3/gcc/objc/objc-act.c
  
  Index: objc-act.c
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/objc/objc-act.c,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- objc-act.c        2002/08/27 22:54:39     1.111
  +++ objc-act.c        2002/08/28 18:23:31     1.112
  @@ -2634,6 +2634,25 @@
     return NULL_TREE;
   }
   
  +/* 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++ */
  +
   /* 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);
     if (chain)
       {
         /* APPLE LOCAl Objective-C++ */
  @@ -6149,20 +6167,6 @@
   
     return 1;
   }
  -
  -/* APPLE LOCAL begin Objective-C++ */
  -/* Implement @defs (<classname>) within struct bodies.  */
  -tree
  -objcp_get_class_ivars (class_name)
  -     tree class_name;
  -{
  -  tree interface = lookup_interface (class_name);
  -  if (interface)
  -    return get_class_ivars (interface);
  -  else
  -    return NULL;
  -}
  -/* APPLE LOCAL end Objective-C++ */
   
   /* Make sure all entries in CHAIN are also in LIST.  */
   
  
  
  
  1.25      +2 -0      gcc3/gcc/objc/objc-act.h
  
  Index: objc-act.h
  ===================================================================
  RCS file: /cvs/Darwin/gcc3/gcc/objc/objc-act.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- objc-act.h        2002/08/26 05:41:28     1.24
  +++ objc-act.h        2002/08/28 18:23:32     1.25
  @@ -50,6 +50,8 @@
   tree add_class_method                                PARAMS ((tree, tree));
   tree add_instance_method                     PARAMS ((tree, tree));
   tree get_super_receiver                              PARAMS ((void));
  +/* APPLE LOCAL Objective-C++ */
  +tree get_class_ivars_from_name                       PARAMS ((tree));
   tree get_class_ivars                         PARAMS ((tree));
   tree get_class_reference                     PARAMS ((tree));
   tree get_static_reference                    PARAMS ((tree, tree));
  
  
  


Reply via email to