Commit 260cd73f by Volker Reichelt Committed by Volker Reichelt

pt.c (template_class_depth_real): Remove.

	* pt.c (template_class_depth_real): Remove. Move functionality to ...
	(template_class_depth): ... here, replacing count_specializations
	with 0.  Adjust comment.

From-SVN: r107498
parent 3f231c29
2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* pt.c (template_class_depth_real): Remove. Move functionality to ...
(template_class_depth): ... here, replacing count_specializations
with 0. Adjust comment.
2005-11-24 Richard Guenther <rguenther@suse.de> 2005-11-24 Richard Guenther <rguenther@suse.de>
Dirk Mueller <dmueller@suse.de> Dirk Mueller <dmueller@suse.de>
......
...@@ -137,7 +137,6 @@ static tree tsubst_template_parms (tree, tree, tsubst_flags_t); ...@@ -137,7 +137,6 @@ static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
static void regenerate_decl_from_template (tree, tree); static void regenerate_decl_from_template (tree, tree);
static tree most_specialized (tree, tree, tree); static tree most_specialized (tree, tree, tree);
static tree most_specialized_class (tree, tree); static tree most_specialized_class (tree, tree);
static int template_class_depth_real (tree, int);
static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int); static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int);
static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree); static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree);
static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree); static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree);
...@@ -266,15 +265,14 @@ finish_member_template_decl (tree decl) ...@@ -266,15 +265,14 @@ finish_member_template_decl (tree decl)
A<T>::B<U> has depth two, while A<T> has depth one. A<T>::B<U> has depth two, while A<T> has depth one.
Both A<T>::B<int> and A<int>::B<U> have depth one, if Both A<T>::B<int> and A<int>::B<U> have depth one, if
COUNT_SPECIALIZATIONS is 0 or if they are instantiations, not they are instantiations, not specializations.
specializations.
This function is guaranteed to return 0 if passed NULL_TREE so This function is guaranteed to return 0 if passed NULL_TREE so
that, for example, `template_class_depth (current_class_type)' is that, for example, `template_class_depth (current_class_type)' is
always safe. */ always safe. */
static int int
template_class_depth_real (tree type, int count_specializations) template_class_depth (tree type)
{ {
int depth; int depth;
...@@ -287,18 +285,14 @@ template_class_depth_real (tree type, int count_specializations) ...@@ -287,18 +285,14 @@ template_class_depth_real (tree type, int count_specializations)
{ {
if (CLASSTYPE_TEMPLATE_INFO (type) if (CLASSTYPE_TEMPLATE_INFO (type)
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)) && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))
&& ((count_specializations && uses_template_parms (CLASSTYPE_TI_ARGS (type)))
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (type))
|| uses_template_parms (CLASSTYPE_TI_ARGS (type))))
++depth; ++depth;
} }
else else
{ {
if (DECL_TEMPLATE_INFO (type) if (DECL_TEMPLATE_INFO (type)
&& PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (type)) && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (type))
&& ((count_specializations && uses_template_parms (DECL_TI_ARGS (type)))
&& DECL_TEMPLATE_SPECIALIZATION (type))
|| uses_template_parms (DECL_TI_ARGS (type))))
++depth; ++depth;
} }
} }
...@@ -306,16 +300,6 @@ template_class_depth_real (tree type, int count_specializations) ...@@ -306,16 +300,6 @@ template_class_depth_real (tree type, int count_specializations)
return depth; return depth;
} }
/* Returns the template nesting level of the indicated class TYPE.
Like template_class_depth_real, but instantiations do not count in
the depth. */
int
template_class_depth (tree type)
{
return template_class_depth_real (type, /*count_specializations=*/0);
}
/* Returns 1 if processing DECL as part of do_pending_inlines /* Returns 1 if processing DECL as part of do_pending_inlines
needs us to push template parms. */ needs us to push template parms. */
......
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