Commit a306451c by Nathan Sidwell Committed by Nathan Sidwell

typeck.c (comp_target_parms): Remove obsolete parameter.

	* typeck.c (comp_target_parms): Remove obsolete parameter.
	(comp_target_types): Adjust.

From-SVN: r35118
parent 4c6b3b2a
2000-07-18 Nathan Sidwell <nathan@codesourcery.com>
* typeck.c (comp_target_parms): Remove obsolete parameter.
(comp_target_types): Adjust.
2000-07-17 Jason Merrill <jason@redhat.com> 2000-07-17 Jason Merrill <jason@redhat.com>
* typeck.c (mark_addressable): Never set TREE_USED. * typeck.c (mark_addressable): Never set TREE_USED.
......
...@@ -46,7 +46,7 @@ static tree convert_for_assignment PARAMS ((tree, tree, const char *, tree, ...@@ -46,7 +46,7 @@ static tree convert_for_assignment PARAMS ((tree, tree, const char *, tree,
int)); int));
static tree pointer_int_sum PARAMS ((enum tree_code, tree, tree)); static tree pointer_int_sum PARAMS ((enum tree_code, tree, tree));
static tree rationalize_conditional_expr PARAMS ((enum tree_code, tree)); static tree rationalize_conditional_expr PARAMS ((enum tree_code, tree));
static int comp_target_parms PARAMS ((tree, tree, int)); static int comp_target_parms PARAMS ((tree, tree));
static int comp_ptr_ttypes_real PARAMS ((tree, tree, int)); static int comp_ptr_ttypes_real PARAMS ((tree, tree, int));
static int comp_ptr_ttypes_const PARAMS ((tree, tree)); static int comp_ptr_ttypes_const PARAMS ((tree, tree));
static int comp_ptr_ttypes_reinterpret PARAMS ((tree, tree)); static int comp_ptr_ttypes_reinterpret PARAMS ((tree, tree));
...@@ -1251,7 +1251,7 @@ comp_target_types (ttl, ttr, nptrs) ...@@ -1251,7 +1251,7 @@ comp_target_types (ttl, ttr, nptrs)
argsr = TREE_CHAIN (argsr); argsr = TREE_CHAIN (argsr);
} }
switch (comp_target_parms (argsl, argsr, 1)) switch (comp_target_parms (argsl, argsr))
{ {
case 0: case 0:
return 0; return 0;
...@@ -1472,9 +1472,8 @@ compparms (parms1, parms2) ...@@ -1472,9 +1472,8 @@ compparms (parms1, parms2)
(jason 17 Apr 1997) */ (jason 17 Apr 1997) */
static int static int
comp_target_parms (parms1, parms2, strict) comp_target_parms (parms1, parms2)
tree parms1, parms2; tree parms1, parms2;
int strict;
{ {
register tree t1 = parms1, t2 = parms2; register tree t1 = parms1, t2 = parms2;
int warn_contravariance = 0; int warn_contravariance = 0;
...@@ -1504,13 +1503,7 @@ comp_target_parms (parms1, parms2, strict) ...@@ -1504,13 +1503,7 @@ comp_target_parms (parms1, parms2, strict)
/* If one parmlist is shorter than the other, /* If one parmlist is shorter than the other,
they fail to match, unless STRICT is <= 0. */ they fail to match, unless STRICT is <= 0. */
if (t1 == 0 || t2 == 0) if (t1 == 0 || t2 == 0)
{ return 0;
if (strict > 0)
return 0;
if (strict < 0)
return 1 + warn_contravariance;
return ((t1 && TREE_PURPOSE (t1)) + warn_contravariance);
}
p1 = TREE_VALUE (t1); p1 = TREE_VALUE (t1);
p2 = TREE_VALUE (t2); p2 = TREE_VALUE (t2);
if (same_type_p (p1, p2)) if (same_type_p (p1, p2))
...@@ -1523,11 +1516,6 @@ comp_target_parms (parms1, parms2, strict) ...@@ -1523,11 +1516,6 @@ comp_target_parms (parms1, parms2, strict)
|| (TREE_CODE (p1) == REFERENCE_TYPE || (TREE_CODE (p1) == REFERENCE_TYPE
&& TREE_CODE (p2) == REFERENCE_TYPE)) && TREE_CODE (p2) == REFERENCE_TYPE))
{ {
if (strict <= 0
&& (TYPE_MAIN_VARIANT (TREE_TYPE (p1))
== TYPE_MAIN_VARIANT (TREE_TYPE (p2))))
continue;
/* The following is wrong for contravariance, /* The following is wrong for contravariance,
but many programs depend on it. */ but many programs depend on it. */
if (TREE_TYPE (p1) == void_type_node) if (TREE_TYPE (p1) == void_type_node)
...@@ -1550,8 +1538,7 @@ comp_target_parms (parms1, parms2, strict) ...@@ -1550,8 +1538,7 @@ comp_target_parms (parms1, parms2, strict)
warn_contravariance = 1; warn_contravariance = 1;
continue; continue;
} }
if (strict != 0) return 0;
return 0;
} }
} }
return warn_contravariance ? -1 : 1; return warn_contravariance ? -1 : 1;
......
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