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.
/* 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. */
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);
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;
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);
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;