aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/class.c64
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/semantics.c2
5 files changed, 35 insertions, 43 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3ec348a..4a5f939 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 4ff41fb..a85b112 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -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. */
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cfb765a..1e84a53 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2c9668f9..35c1367 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index a5130a5..11f5ff0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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