austern     03/01/03 16:04:18

  Modified:    live/gcc3/gcc/cp class.c cp-tree.h decl.c decl2.c pt.c
  Log:
  Reviewed by: Geoff
  Cosmetic changes due to submitting a patch to FSF.
  
  Revision  Changes    Path
  1.41      +5 -12     src/live/gcc3/gcc/cp/class.c
  
  Index: class.c
  ===================================================================
  RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/class.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- class.c   2002/12/24 17:27:26     1.40
  +++ class.c   2003/01/04 00:04:15     1.41
  @@ -5475,12 +5475,7 @@
          method = TREE_CHAIN (method))
       if (DECL_VINDEX (method) != NULL_TREE
        && ! DECL_DECLARED_INLINE_P (method)
  -     && (! DECL_PURE_VIRTUAL_P (method)
  -#if 0
  -         /* This would be nice, but we didn't think of it in time.  */
  -         || DECL_DESTRUCTOR_P (method)
  -#endif
  -         ))
  +     && ! DECL_PURE_VIRTUAL_P (method))
         return method;
   
     return NULL_TREE;
  @@ -5534,12 +5529,10 @@
       {
         CLASSTYPE_KEY_METHOD (t) = key_method (t);
   
  -      /* If a polymorphic class has no key method, emit the vtable in
  -      every translation unit where the class definition appear. */
  -      if (CLASSTYPE_KEY_METHOD (t) == NULL_TREE && !processing_template_decl)
  -     {
  -       dynamic_classes = tree_cons (NULL_TREE, t, dynamic_classes);
  -     }
  +      /* If a polymorphic class has no key method, we may emit the vtable
  +      in every translation unit where the class definition appears. */
  +      if (CLASSTYPE_KEY_METHOD (t) == NULL_TREE)
  +     keyed_classes = tree_cons (NULL_TREE, t, keyed_classes);
       }
   
     /* Layout the class itself.  */
  
  
  
  1.77      +2 -2      src/live/gcc3/gcc/cp/cp-tree.h
  
  Index: cp-tree.h
  ===================================================================
  RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/cp-tree.h,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- cp-tree.h 2002/12/24 17:27:26     1.76
  +++ cp-tree.h 2003/01/04 00:04:15     1.77
  @@ -615,7 +615,7 @@
       CPTI_DSO_HANDLE,
       CPTI_DCAST,
   
  -    CPTI_DYNAMIC_CLASSES,
  +    CPTI_KEYED_CLASSES,
   
       /* APPLE LOCAL begin 2.95-ptmf-compatibility  turly 20020313  */
       CPTI_DELTA2_IDENTIFIER,
  @@ -764,7 +764,7 @@
   /* A TREE_LIST of the dynamic classes whose vtables may have to be
      emitted in this translation unit.  */
   
  -#define dynamic_classes                 cp_global_trees[CPTI_DYNAMIC_CLASSES]
  +#define keyed_classes                   cp_global_trees[CPTI_KEYED_CLASSES]
   
   /* Global state.  */
   
  
  
  
  1.126     +9 -8      src/live/gcc3/gcc/cp/decl.c
  
  Index: decl.c
  ===================================================================
  RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/decl.c,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- decl.c    2002/12/24 17:27:26     1.125
  +++ decl.c    2003/01/04 00:04:15     1.126
  @@ -14970,15 +14970,16 @@
         && DECL_VIRTUAL_P (fndecl)
         && !processing_template_decl)
       {
  -      tree fnclass = DECL_CLASS_CONTEXT (fndecl);
  +      tree fnclass = DECL_CONTEXT (fndecl);
         if (fndecl == CLASSTYPE_KEY_METHOD (fnclass))
  -     {
  -       /* If the function we thought was the key method turns out
  -          to be inline, then the class has no key method.  */
  -       if (DECL_DECLARED_INLINE_P (fndecl))
  -         CLASSTYPE_KEY_METHOD (fnclass) = NULL_TREE;
  -
  -       dynamic_classes = tree_cons (NULL_TREE, fnclass, dynamic_classes);
  +     {
  +       /* If the function we thought was the key method turns out
  +          to be inline, then the class has no key method.  (This
  +          isn't what the C++ ABI document calls for, but it's what
  +          we did in 3.1) */
  +       if (DECL_DECLARED_INLINE_P (fndecl))
  +         CLASSTYPE_KEY_METHOD (fnclass) = NULL_TREE;
  +       keyed_classes = tree_cons (NULL_TREE, fnclass, keyed_classes);
        }
       }
     /* APPLE LOCAL end improved vtable emission fsf candidate */
  
  
  
  1.101     +4 -4      src/live/gcc3/gcc/cp/decl2.c
  
  Index: decl2.c
  ===================================================================
  RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/decl2.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- decl2.c   2002/12/24 17:27:27     1.100
  +++ decl2.c   2003/01/04 00:04:16     1.101
  @@ -2852,14 +2852,14 @@
         vtables then we remove the class from our list so we don't
         have to look at it again. */
   
  -      while (dynamic_classes != NULL_TREE
  -          && maybe_emit_vtables (TREE_VALUE (dynamic_classes)))
  +      while (keyed_classes != NULL_TREE
  +          && maybe_emit_vtables (TREE_VALUE (keyed_classes)))
        {
          reconsider = 1;
  -       dynamic_classes = TREE_CHAIN (dynamic_classes);
  +       keyed_classes = TREE_CHAIN (keyed_classes);
        }
   
  -      t = dynamic_classes;
  +      t = keyed_classes;
         if (t != NULL_TREE)
        {
          tree next = TREE_CHAIN (t);
  
  
  
  1.36      +1 -1      src/live/gcc3/gcc/cp/pt.c
  
  Index: pt.c
  ===================================================================
  RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/pt.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- pt.c      2002/12/24 17:27:27     1.35
  +++ pt.c      2003/01/04 00:04:16     1.36
  @@ -5471,7 +5471,7 @@
   
     /* APPLE LOCAL begin improved vtable emission fsf candidate */
     if (TYPE_CONTAINS_VPTR_P (type))
  -    dynamic_classes = tree_cons (NULL_TREE, type, dynamic_classes);
  +    keyed_classes = tree_cons (NULL_TREE, type, keyed_classes);
     /* APPLE LOCAL end improved vtable emission fsf candidate */
   
     return type;
  
  
  


Reply via email to