Commit 31a714f6 by Mark Mitchell Committed by Mark Mitchell

class.c (pushclass): Remove #if 0'd code.

	* class.c (pushclass): Remove #if 0'd code.
	* cp-tree.h (overload_template_name): Remove.
	* decl.c (store_bindings): Simplify.
	(pop_from_top_level): Likewise.
	* pt.c (overload_template_name): Remove.
	(instantiate_decl): Don't call push_to_top_level if it's not
	needed.

From-SVN: r38530
parent d40fb373
2000-12-29 Mark Mitchell <mark@codesourcery.com>
* class.c (pushclass): Remove #if 0'd code.
* cp-tree.h (overload_template_name): Remove.
* decl.c (store_bindings): Simplify.
(pop_from_top_level): Likewise.
* pt.c (overload_template_name): Remove.
(instantiate_decl): Don't call push_to_top_level if it's not
needed.
2000-12-28 Mark Mitchell <mark@codesourcery.com> 2000-12-28 Mark Mitchell <mark@codesourcery.com>
* pt.c (register_local_specialization): Don't return a value. * pt.c (register_local_specialization): Don't return a value.
......
...@@ -5603,11 +5603,6 @@ pushclass (type, modify) ...@@ -5603,11 +5603,6 @@ pushclass (type, modify)
pushlevel_class (); pushlevel_class ();
#if 0
if (CLASSTYPE_TEMPLATE_INFO (type))
overload_template_name (type);
#endif
if (modify) if (modify)
{ {
if (type != previous_class_type || current_class_depth > 1) if (type != previous_class_type || current_class_depth > 1)
......
...@@ -4186,7 +4186,6 @@ extern tree lookup_template_function PARAMS ((tree, tree)); ...@@ -4186,7 +4186,6 @@ extern tree lookup_template_function PARAMS ((tree, tree));
extern int uses_template_parms PARAMS ((tree)); extern int uses_template_parms PARAMS ((tree));
extern tree instantiate_class_template PARAMS ((tree)); extern tree instantiate_class_template PARAMS ((tree));
extern tree instantiate_template PARAMS ((tree, tree)); extern tree instantiate_template PARAMS ((tree, tree));
extern void overload_template_name PARAMS ((tree));
extern int fn_type_unification PARAMS ((tree, tree, tree, tree, tree, unification_kind_t, int)); extern int fn_type_unification PARAMS ((tree, tree, tree, tree, tree, unification_kind_t, int));
extern tree tinst_for_decl PARAMS ((void)); extern tree tinst_for_decl PARAMS ((void));
extern void mark_decl_instantiated PARAMS ((tree, int)); extern void mark_decl_instantiated PARAMS ((tree, int));
......
...@@ -2447,18 +2447,14 @@ store_bindings (names, old_bindings) ...@@ -2447,18 +2447,14 @@ store_bindings (names, old_bindings)
if (TREE_VEC_ELT (t1, 0) == id) if (TREE_VEC_ELT (t1, 0) == id)
goto skip_it; goto skip_it;
my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 135);
binding = make_tree_vec (4); binding = make_tree_vec (4);
TREE_VEC_ELT (binding, 0) = id;
if (id) TREE_VEC_ELT (binding, 1) = REAL_IDENTIFIER_TYPE_VALUE (id);
{ TREE_VEC_ELT (binding, 2) = IDENTIFIER_BINDING (id);
my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 135); TREE_VEC_ELT (binding, 3) = IDENTIFIER_CLASS_VALUE (id);
TREE_VEC_ELT (binding, 0) = id; IDENTIFIER_BINDING (id) = NULL_TREE;
TREE_VEC_ELT (binding, 1) = REAL_IDENTIFIER_TYPE_VALUE (id); IDENTIFIER_CLASS_VALUE (id) = NULL_TREE;
TREE_VEC_ELT (binding, 2) = IDENTIFIER_BINDING (id);
TREE_VEC_ELT (binding, 3) = IDENTIFIER_CLASS_VALUE (id);
IDENTIFIER_BINDING (id) = NULL_TREE;
IDENTIFIER_CLASS_VALUE (id) = NULL_TREE;
}
TREE_CHAIN (binding) = old_bindings; TREE_CHAIN (binding) = old_bindings;
old_bindings = binding; old_bindings = binding;
skip_it: skip_it:
...@@ -2552,12 +2548,10 @@ pop_from_top_level () ...@@ -2552,12 +2548,10 @@ pop_from_top_level ()
for (t = s->old_bindings; t; t = TREE_CHAIN (t)) for (t = s->old_bindings; t; t = TREE_CHAIN (t))
{ {
tree id = TREE_VEC_ELT (t, 0); tree id = TREE_VEC_ELT (t, 0);
if (id)
{ SET_IDENTIFIER_TYPE_VALUE (id, TREE_VEC_ELT (t, 1));
SET_IDENTIFIER_TYPE_VALUE (id, TREE_VEC_ELT (t, 1)); IDENTIFIER_BINDING (id) = TREE_VEC_ELT (t, 2);
IDENTIFIER_BINDING (id) = TREE_VEC_ELT (t, 2); IDENTIFIER_CLASS_VALUE (id) = TREE_VEC_ELT (t, 3);
IDENTIFIER_CLASS_VALUE (id) = TREE_VEC_ELT (t, 3);
}
} }
/* If we were in the middle of compiling a function, restore our /* If we were in the middle of compiling a function, restore our
......
...@@ -7558,24 +7558,6 @@ instantiate_template (tmpl, targ_ptr) ...@@ -7558,24 +7558,6 @@ instantiate_template (tmpl, targ_ptr)
return fndecl; return fndecl;
} }
/* Push the name of the class template into the scope of the instantiation. */
void
overload_template_name (type)
tree type;
{
tree id = DECL_NAME (CLASSTYPE_TI_TEMPLATE (type));
tree decl;
if (IDENTIFIER_CLASS_VALUE (id)
&& TREE_TYPE (IDENTIFIER_CLASS_VALUE (id)) == type)
return;
decl = build_decl (TYPE_DECL, id, type);
DECL_ARTIFICIAL (decl) = 1;
pushdecl_class_level (decl);
}
/* The FN is a TEMPLATE_DECL for a function. The ARGS are the /* The FN is a TEMPLATE_DECL for a function. The ARGS are the
arguments that are being used when calling it. TARGS is a vector arguments that are being used when calling it. TARGS is a vector
into which the deduced template arguments are placed. into which the deduced template arguments are placed.
...@@ -9621,6 +9603,7 @@ instantiate_decl (d, defer_ok) ...@@ -9621,6 +9603,7 @@ instantiate_decl (d, defer_ok)
tree gen_tmpl; tree gen_tmpl;
int pattern_defined; int pattern_defined;
int line = lineno; int line = lineno;
int need_push;
const char *file = input_filename; const char *file = input_filename;
/* This function should only be used to instantiate templates for /* This function should only be used to instantiate templates for
...@@ -9776,7 +9759,9 @@ instantiate_decl (d, defer_ok) ...@@ -9776,7 +9759,9 @@ instantiate_decl (d, defer_ok)
goto out; goto out;
} }
push_to_top_level (); need_push = !global_bindings_p ();
if (need_push)
push_to_top_level ();
/* We're now committed to instantiating this template. Mark it as /* We're now committed to instantiating this template. Mark it as
instantiated so that recursive calls to instantiate_decl do not instantiated so that recursive calls to instantiate_decl do not
...@@ -9840,7 +9825,8 @@ instantiate_decl (d, defer_ok) ...@@ -9840,7 +9825,8 @@ instantiate_decl (d, defer_ok)
/* We're not deferring instantiation any more. */ /* We're not deferring instantiation any more. */
TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (d)) = 0; TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (d)) = 0;
pop_from_top_level (); if (need_push)
pop_from_top_level ();
out: out:
lineno = line; lineno = line;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment