summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-09 01:47:02 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-09 01:47:02 +0000
commita35129cfe87e528f0320e25847f251d11a0dba1e (patch)
tree99fb477a3cc844029dcf76027bc5741f2b2330df /gcc
parent9f9b198334f85a4345df8951943a8f2c60159fdf (diff)
downloadgcc-a35129cfe87e528f0320e25847f251d11a0dba1e.tar.gz
* cp-tree.h (saved_scope): Remove old_binding_level and
function_decl. Tidy up. * decl.c (mark_saved_scope): Don't set them. (maybe_push_to_top_level): Clear memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cp-tree.h15
-rw-r--r--gcc/cp/decl.c24
3 files changed, 21 insertions, 23 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ddd0c68e10c..a15b3bb2820 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
1999-09-08 Mark Mitchell <mark@codesourcery.com>
+ * cp-tree.h (saved_scope): Remove old_binding_level and
+ function_decl. Tidy up.
+ * decl.c (mark_saved_scope): Don't set them.
+ (maybe_push_to_top_level): Clear memory.
+
* decl.c (layout_var_decl): Change prototype. Don't complete
types for external objects.
(check_initializer): Likewise. Tidy.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index bba4076b856..6da2463350d 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -520,25 +520,28 @@ extern tree cp_global_trees[CPTI_MAX];
/* Global state. */
struct saved_scope {
- struct binding_level *old_binding_level;
tree old_bindings;
tree old_namespace;
- struct saved_scope *prev;
- tree class_name, class_type;
+ tree class_name;
+ tree class_type;
tree access_specifier;
- tree function_decl;
- struct binding_level *class_bindings;
varray_type lang_base;
tree *lang_stack;
tree lang_name;
tree x_function_parms;
tree template_parms;
- HOST_WIDE_INT x_processing_template_decl;
tree x_previous_class_type;
tree x_previous_class_values;
+
+ HOST_WIDE_INT x_processing_template_decl;
int x_processing_specialization;
int x_processing_explicit_instantiation;
+
char *firstobj;
+
+ struct binding_level *class_bindings;
+
+ struct saved_scope *prev;
};
/* The current open namespace. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c75cddcd1c1..dc2850e2448 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2382,14 +2382,12 @@ mark_saved_scope (arg)
struct saved_scope *t = *(struct saved_scope **)arg;
while (t)
{
- mark_binding_level (&t->old_binding_level);
mark_binding_level (&t->class_bindings);
ggc_mark_tree (t->old_bindings);
ggc_mark_tree (t->old_namespace);
ggc_mark_tree (t->class_name);
ggc_mark_tree (t->class_type);
ggc_mark_tree (t->access_specifier);
- ggc_mark_tree (t->function_decl);
if (t->lang_base)
ggc_mark_tree_varray (t->lang_base);
ggc_mark_tree (t->lang_name);
@@ -2451,7 +2449,7 @@ maybe_push_to_top_level (pseudo)
int pseudo;
{
struct saved_scope *s
- = (struct saved_scope *) xmalloc (sizeof (struct saved_scope));
+ = (struct saved_scope *) xcalloc (1, sizeof (struct saved_scope));
struct binding_level *b;
tree old_bindings = NULL_TREE;
@@ -2485,28 +2483,18 @@ maybe_push_to_top_level (pseudo)
for (t = b->type_shadowed; t; t = TREE_CHAIN (t))
SET_IDENTIFIER_TYPE_VALUE (TREE_PURPOSE (t), TREE_VALUE (t));
}
- if (scope_chain)
- *s = *scope_chain;
- s->old_binding_level = scope_chain ? current_binding_level : 0;
- s->old_bindings = old_bindings;
- s->prev = scope_chain;
- scope_chain = s;
current_binding_level = b;
- current_class_name = current_class_type = NULL_TREE;
+ s->prev = scope_chain;
+ s->old_bindings = old_bindings;
+
+ scope_chain = s;
current_function_decl = NULL_TREE;
- class_binding_level = (struct binding_level *)0;
VARRAY_TREE_INIT (current_lang_base, 10, "current_lang_base");
current_lang_stack = &VARRAY_TREE (current_lang_base, 0);
current_lang_name = lang_name_cplusplus;
strict_prototype = strict_prototypes_lang_cplusplus;
named_labels = NULL_TREE;
- previous_class_type = previous_class_values = NULL_TREE;
- class_cache_firstobj = 0;
- processing_specialization = 0;
- processing_explicit_instantiation = 0;
- current_template_parms = NULL_TREE;
- processing_template_decl = 0;
current_namespace = global_namespace;
push_obstacks (&permanent_obstack, &permanent_obstack);
@@ -7486,6 +7474,8 @@ check_initializer (decl, init)
if (TREE_CODE (decl) == FIELD_DECL)
return init;
+ type = TREE_TYPE (decl);
+
/* If `start_decl' didn't like having an initialization, ignore it now. */
if (init != NULL_TREE && DECL_INITIAL (decl) == NULL_TREE)
init = NULL_TREE;