(init_class_processing): Don't initialize class_obstack.
(push_cache_obstack): Remove.
(pushclass): Don't call it.
* cp-tree.h: Remove prototype for push_cache_obstack.
* decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
(pushlevel_class): Don't push_decl_level.
(poplevel_class): Don't pop_stack_level.
(push_class_level_binding): Don't push_cache_obstack.
(init_decl_processing): Don't intialize decl_obstack.
* search.c (push_class_decls): Don't push_cache_obstack.
* tree.c (list_hash_add): Put hash node on permanent_obstack.
(hash_tree_cons): Don't mess with obstacks.
(print_lang_statistics): Don't print stats for class_obstack and
decl_obstack.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29711
138bc75d-0d04-0410-961f-
82ee72b054a4
+1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
+
+ * class.c (class_cache_obstack, class_obstack): Remove.
+ (init_class_processing): Don't initialize class_obstack.
+ (push_cache_obstack): Remove.
+ (pushclass): Don't call it.
+ * cp-tree.h: Remove prototype for push_cache_obstack.
+ * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
+ (pushlevel_class): Don't push_decl_level.
+ (poplevel_class): Don't pop_stack_level.
+ (push_class_level_binding): Don't push_cache_obstack.
+ (init_decl_processing): Don't intialize decl_obstack.
+ * search.c (push_class_decls): Don't push_cache_obstack.
+ * tree.c (list_hash_add): Put hash node on permanent_obstack.
+ (hash_tree_cons): Don't mess with obstacks.
+ (print_lang_statistics): Don't print stats for class_obstack and
+ decl_obstack.
+
1999-09-29 Mark Mitchell <mark@codesourcery.com>
* dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
static int current_class_stack_size;
static class_stack_node_t current_class_stack;
-/* The obstack on which the cached class declarations are kept. */
-static struct obstack class_cache_obstack;
-
struct base_info;
static tree get_vfield_name PROTO((tree));
*phv = pending_hard_virtuals;
}
\f
-/* Obstack on which to build the vector of class methods. */
-struct obstack class_obstack;
extern struct obstack *current_obstack;
/* Add method METHOD to class TYPE.
access_public_virtual_node = build_int_2 (5, 0);
access_protected_virtual_node = build_int_2 (6, 0);
access_private_virtual_node = build_int_2 (7, 0);
-
- gcc_obstack_init (&class_obstack);
}
/* Set current scope to NAME. CODE tells us if this is a
{
/* Forcibly remove any old class remnants. */
invalidate_class_lookup_cache ();
-
- /* Now, free the obstack on which we cached all the values. */
- if (class_cache_firstobj)
- obstack_free (&class_cache_obstack, class_cache_firstobj);
- class_cache_firstobj
- = (char*) obstack_finish (&class_cache_obstack);
}
/* If we're about to enter a nested class, clear
#endif
}
-/* Push an obstack which is sufficiently long-lived to hold such class
- decls that may be cached in the previous_class_values list. The
- effect is undone by pop_obstacks. */
-
-void
-push_cache_obstack ()
-{
- static int cache_obstack_initialized;
-
- if (!cache_obstack_initialized)
- {
- gcc_obstack_init (&class_cache_obstack);
- class_cache_firstobj
- = (char*) obstack_finish (&class_cache_obstack);
- cache_obstack_initialized = 1;
- }
-
- push_obstacks_nochange ();
- current_obstack = &class_cache_obstack;
-}
-
/* Build a dummy reference to ourselves so Derived::Base (and A::A) works,
according to [class]:
The class-name is also inserted
extern void pop_lang_context PROTO((void));
extern tree instantiate_type PROTO((tree, tree, int));
extern void print_class_statistics PROTO((void));
-extern void push_cache_obstack PROTO((void));
extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *, tree));
extern void build_self_reference PROTO((void));
extern void warn_hidden PROTO((tree));
int ggc_p = 1;
-/* Obstack used for remembering local class declarations (like
- enums and static (const) members. */
-#include "stack.h"
-struct obstack decl_obstack;
-static struct stack_level *decl_stack;
-
#ifndef WCHAR_UNSIGNED
#define WCHAR_UNSIGNED 0
#endif
static tree grokparms PROTO((tree, int));
static const char *redeclaration_error_message PROTO((tree, tree));
-static struct stack_level *push_decl_level PROTO((struct stack_level *,
- struct obstack *));
static void push_binding_level PROTO((struct binding_level *, int,
int));
static void pop_binding_level PROTO((void));
tree anonymous_namespace_name;
\f
-/* Allocate a level of searching. */
-
-static
-struct stack_level *
-push_decl_level (stack, obstack)
- struct stack_level *stack;
- struct obstack *obstack;
-{
- struct stack_level tem;
- tem.prev = stack;
-
- return push_stack_level (obstack, (char *)&tem, sizeof (tem));
-}
-\f
/* For each binding contour we allocate a binding_level structure
which records the names defined in that contour.
Contours include:
push_binding_level (newlevel, 0, 0);
- decl_stack = push_decl_level (decl_stack, &decl_obstack);
class_binding_level = current_binding_level;
class_binding_level->parm_flag = 2;
}
my_friendly_assert (level != 0, 354);
- decl_stack = pop_stack_level (decl_stack);
/* If we're leaving a toplevel class, don't bother to do the setting
of IDENTIFIER_CLASS_VALUE to NULL_TREE, since first of all this slot
shouldn't even be used when current_class_type isn't set, and second,
IDENTIFIER_CLASS_VALUE. */
if (push_class_binding (name, x))
{
- push_cache_obstack ();
class_binding_level->class_shadowed
= tree_cons (name, IDENTIFIER_CLASS_VALUE (name),
class_binding_level->class_shadowed);
- pop_obstacks ();
/* Record the value we are binding NAME to so that we can know
what to pop later. */
TREE_TYPE (class_binding_level->class_shadowed) = x;
signal (SIGBUS, signal_catch);
#endif
- gcc_obstack_init (&decl_obstack);
-
build_common_tree_nodes (flag_signed_char);
error_mark_list = build_tree_list (error_mark_node, error_mark_node);
D1 is the PTYPENAME terminal, and ARGLIST is the list of arguments.
(Actually ARGLIST may be either a TREE_LIST or a TREE_VEC. It will
be a TREE_LIST if called directly from the parser, and a TREE_VEC
- otherwise.) Since ARGLIST is build on the decl_obstack, we must
+ otherwise.) Since ARGLIST is build on the temp_decl_obstack, we must
copy it here to keep it from being reclaimed when the decl storage
is reclaimed.
push_class_decls (type)
tree type;
{
- struct obstack *ambient_obstack = current_obstack;
search_stack = push_search_level (search_stack, &search_obstack);
- /* Build up all the relevant bindings and such on the cache
- obstack. That way no memory is wasted when we throw away the
- cache later. */
- push_cache_obstack ();
-
/* Enter type declarations and mark. */
dfs_walk (TYPE_BINFO (type), dfs_push_type_decls, unmarked_pushdecls_p, 0);
/* Enter non-type declarations and unmark. */
dfs_walk (TYPE_BINFO (type), dfs_push_decls, marked_pushdecls_p, 0);
-
- /* Undo the call to push_cache_obstack above. */
- pop_obstacks ();
-
- current_obstack = ambient_obstack;
}
/* Here's a subroutine we need because C lacks lambdas. */
}
\f
extern struct obstack *current_obstack;
-extern struct obstack permanent_obstack, class_obstack;
+extern struct obstack permanent_obstack;
extern struct obstack *saveable_obstack;
extern struct obstack *expression_obstack;
{
register struct list_hash *h;
- h = (struct list_hash *) obstack_alloc (&class_obstack, sizeof (struct list_hash));
+ h = (struct list_hash *) obstack_alloc (&permanent_obstack, sizeof (struct list_hash));
h->hashcode = hashcode;
h->list = list;
h->next = list_hash_table[hashcode % TYPE_HASH_SIZE];
hash_tree_cons (purpose, value, chain)
tree purpose, value, chain;
{
- struct obstack *ambient_obstack = current_obstack;
tree t;
int hashcode = 0;
return t;
}
- current_obstack = &class_obstack;
-
t = tree_cons (purpose, value, chain);
/* If this is a new list, record it for later reuse. */
if (! debug_no_list_hash)
list_hash_add (hashcode, t);
- current_obstack = ambient_obstack;
return t;
}
void
print_lang_statistics ()
{
- extern struct obstack decl_obstack;
- print_obstack_statistics ("class_obstack", &class_obstack);
- print_obstack_statistics ("decl_obstack", &decl_obstack);
print_search_statistics ();
print_class_statistics ();
#ifdef GATHER_STATISTICS