OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Aug 2003 11:01:38 +0000 (11:01 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 2 Aug 2003 11:01:38 +0000 (11:01 +0000)
* cp-tree.h (pushclass): Remove unneeded parameter.
* class.c (pushclass): Remove unneeded MODIFY parm. Adjust.
(push_nested_class): Adjust pushclass call.
* pt.c (instantiate_class_template): Likewise.
* semantics.c (begin_class_definition): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70101 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/semantics.c

index 3ec348a..4a5f939 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-02  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * cp-tree.h (pushclass): Remove unneeded parameter.
+       * class.c (pushclass): Remove unneeded MODIFY parm. Adjust.
+       (push_nested_class): Adjust pushclass call.
+       * pt.c (instantiate_class_template): Likewise.
+       * semantics.c (begin_class_definition): Likewise.
+
 2003-08-01  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * typeck2.c (add_exception_specifier): Use 'bool' where appropriate.
index 4ff41fb..a85b112 100644 (file)
@@ -5395,19 +5395,6 @@ init_class_processing (void)
 /* Set global variables CURRENT_CLASS_NAME and CURRENT_CLASS_TYPE as
    appropriate for TYPE.
 
-   If MODIFY is 1, we set IDENTIFIER_CLASS_VALUE's of names
-   which can be seen locally to the class.  They are shadowed by
-   any subsequent local declaration (including parameter names).
-
-   If MODIFY is 2, we set IDENTIFIER_CLASS_VALUE's of names
-   which have static meaning (i.e., static members, static
-   member functions, enum declarations, etc).
-
-   If MODIFY is 3, we set IDENTIFIER_CLASS_VALUE of names
-   which can be seen locally to the class (as in 1), but
-   know that we are doing this for declaration purposes
-   (i.e. friend foo::bar (int)).
-
    So that we may avoid calls to lookup_name, we cache the _TYPE
    nodes of local TYPE_DECLs in the TREE_TYPE field of the name.
 
@@ -5420,7 +5407,7 @@ init_class_processing (void)
    that name becomes `error_mark_node'.  */
 
 void
-pushclass (tree type, bool modify)
+pushclass (tree type)
 {
   type = TYPE_MAIN_VARIANT (type);
 
@@ -5464,39 +5451,36 @@ pushclass (tree type, bool modify)
 
   /* If we're about to enter a nested class, clear
      IDENTIFIER_CLASS_VALUE for the enclosing classes.  */
-  if (modify && current_class_depth > 1)
+  if (current_class_depth > 1)
     clear_identifier_class_values ();
 
   pushlevel_class ();
 
-  if (modify)
+  if (type != previous_class_type || current_class_depth > 1)
+    push_class_decls (type);
+  else
     {
-      if (type != previous_class_type || current_class_depth > 1)
-       push_class_decls (type);
-      else
-       {
-         tree item;
-
-         /* We are re-entering the same class we just left, so we
-            don't have to search the whole inheritance matrix to find
-            all the decls to bind again.  Instead, we install the
-            cached class_shadowed list, and walk through it binding
-            names and setting up IDENTIFIER_TYPE_VALUEs.  */
-         set_class_shadows (previous_class_values);
-         for (item = previous_class_values; item; item = TREE_CHAIN (item))
-           {
-             tree id = TREE_PURPOSE (item);
-             tree decl = TREE_TYPE (item);
+      tree item;
 
-             push_class_binding (id, decl);
-             if (TREE_CODE (decl) == TYPE_DECL)
-               set_identifier_type_value (id, TREE_TYPE (decl));
-           }
-         unuse_fields (type);
+      /* We are re-entering the same class we just left, so we don't
+        have to search the whole inheritance matrix to find all the
+        decls to bind again.  Instead, we install the cached
+        class_shadowed list, and walk through it binding names and
+        setting up IDENTIFIER_TYPE_VALUEs.  */
+      set_class_shadows (previous_class_values);
+      for (item = previous_class_values; item; item = TREE_CHAIN (item))
+       {
+         tree id = TREE_PURPOSE (item);
+         tree decl = TREE_TYPE (item);
+         
+         push_class_binding (id, decl);
+         if (TREE_CODE (decl) == TYPE_DECL)
+           set_identifier_type_value (id, TREE_TYPE (decl));
        }
-
-      cxx_remember_type_decls (CLASSTYPE_NESTED_UTDS (type));
+      unuse_fields (type);
     }
+  
+  cxx_remember_type_decls (CLASSTYPE_NESTED_UTDS (type));
 }
 
 /* When we exit a toplevel class scope, we save the
@@ -5598,7 +5582,7 @@ push_nested_class (tree type)
 
   if (context && CLASS_TYPE_P (context))
     push_nested_class (context);
-  pushclass (type, true);
+  pushclass (type);
 }
 
 /* Undoes a push_nested_class call.  */
index cfb765a..1e84a53 100644 (file)
@@ -3582,7 +3582,7 @@ extern void finish_struct_1                       (tree);
 extern int resolves_to_fixed_type_p            (tree, int *);
 extern void init_class_processing              (void);
 extern int is_empty_class                      (tree);
-extern void pushclass                          (tree, bool);
+extern void pushclass                          (tree);
 extern void popclass                           (void);
 extern void push_nested_class                  (tree);
 extern void pop_nested_class                   (void);
index 2c9668f..35c1367 100644 (file)
@@ -5225,7 +5225,7 @@ instantiate_class_template (tree type)
      correctly.  This is precisely analogous to what we do in
      begin_class_definition when defining an ordinary non-template
      class.  */
-  pushclass (type, true);
+  pushclass (type);
 
   /* Now members are processed in the order of declaration.  */
   for (member = CLASSTYPE_DECL_LIST (pattern);
index a5130a5..11f5ff0 100644 (file)
@@ -2025,7 +2025,7 @@ begin_class_definition (tree t)
       pushtag (TYPE_IDENTIFIER (t), t, 0);
     }
   maybe_process_partial_specialization (t);
-  pushclass (t, true);
+  pushclass (t);
   TYPE_BEING_DEFINED (t) = 1;
   TYPE_PACKED (t) = flag_pack_struct;
   /* Reset the interface data, at the earliest possible