This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

{signed_or_un,un,}signed_type langhooks


Like the previous hooks, there is no reasonable default.

Bootstrapped and regtesting.  OK?

Neil.

	* c-common.c (unsigned_conversion_warning, convert_and_check,
	unsigned_type, signed_type, shorten_compare,
	c_common_get_alias_set, c_common_nodes_and_builtins): Use new hooks.
	(unsigned_type, signed_type, signed_or_unsigned_type): Rename.
	* c-common.h (unsigned_type, signed_type, signed_or_unsigned_type):
	New.
	* c-decl.c (grokdeclarator): Update.
	* c-format.c (check_format_types): Update.
	* c-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
	* c-typeck.c (build_binary_op, convert_for_assignment): Update.
	* convert.c (convert_to_integer): Use new hooks.
	* expmed.c (make_tree): Use new hooks.
	* expr.c (store_expr): Use new hooks.
	* fold-const.c (operand_equal_for_comparison_p, build_range_check,
	all_ones_mask_p, unextend, fold): Use new hooks.
	* langhooks.h (struct lang_hooks_for_types): New hooks.
	* tree.h (signed_or_unsigned_type, signed_type,
	unsigned_type): Remove.
ada:
	* gigi.h (unsigned_type, signed_type, signed_or_unsigned_type):
	Rename.
	* misc.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
	* trans.c (tree_transform, convert_with_check): Update.
	* utils.c (unsigned_type, signed_type, signed_or_unsigned_type):
	Rename.
cp:
	* cp-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
	* decl.c (grokdeclarator): Update.
	* mangle.c (write_integer_cst): Update.
	* typeck.c (build_binary_op): Update.
f:
	* com.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
	(unsigned_type, signed_type, signed_or_unsigned_type): Rename.
java:
	* expr.c (build_java_binop): Update.
	* java-tree.h (java_signed_type, java_unsigned_type,
	java_signed_or_unsigned_type): Update.
	* lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
	* parse.y (patch_binop): Update.
	* typeck.c (signed_or_unsigned_type, unsigned_type,
	signed_type): Update.
objc:
	* objc-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
	LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.

============================================================
Index: gcc/c-common.c
--- gcc/c-common.c	2002/03/29 21:45:56	1.305
+++ gcc/c-common.c	2002/03/29 23:39:35
@@ -757,13 +757,15 @@ void
 unsigned_conversion_warning (result, operand)
      tree result, operand;
 {
+  tree type = TREE_TYPE (result);
+
   if (TREE_CODE (operand) == INTEGER_CST
-      && TREE_CODE (TREE_TYPE (result)) == INTEGER_TYPE
-      && TREE_UNSIGNED (TREE_TYPE (result))
+      && TREE_CODE (type) == INTEGER_TYPE
+      && TREE_UNSIGNED (type)
       && skip_evaluation == 0
-      && !int_fits_type_p (operand, TREE_TYPE (result)))
+      && !int_fits_type_p (operand, type))
     {
-      if (!int_fits_type_p (operand, signed_type (TREE_TYPE (result))))
+      if (!int_fits_type_p (operand, c_common_signed_type (type)))
 	/* This detects cases like converting -129 or 256 to unsigned char.  */
 	warning ("large integer implicitly truncated to unsigned type");
       else if (warn_conversion)
@@ -812,7 +814,8 @@ convert_and_check (type, expr)
 	       don't warn unless pedantic.  */
 	    if ((pedantic
 		 || TREE_UNSIGNED (type)
-		 || ! constant_fits_type_p (expr, unsigned_type (type)))
+		 || ! constant_fits_type_p (expr,
+					    c_common_unsigned_type (type)))
 	        && skip_evaluation == 0)
 	      warning ("overflow in implicit constant conversion");
 	}
@@ -1435,7 +1438,7 @@ c_common_type_for_mode (mode, unsignedp)
 
 /* Return an unsigned type the same as TYPE in other respects.  */
 tree
-unsigned_type (type)
+c_common_unsigned_type (type)
      tree type;
 {
   tree type1 = TYPE_MAIN_VARIANT (type);
@@ -1464,13 +1467,13 @@ unsigned_type (type)
   if (type1 == intQI_type_node)
     return unsigned_intQI_type_node;
 
-  return signed_or_unsigned_type (1, type);
+  return c_common_signed_or_unsigned_type (1, type);
 }
 
 /* Return a signed type the same as TYPE in other respects.  */
 
 tree
-signed_type (type)
+c_common_signed_type (type)
      tree type;
 {
   tree type1 = TYPE_MAIN_VARIANT (type);
@@ -1499,14 +1502,14 @@ signed_type (type)
   if (type1 == unsigned_intQI_type_node)
     return intQI_type_node;
 
-  return signed_or_unsigned_type (0, type);
+  return c_common_signed_or_unsigned_type (0, type);
 }
 
 /* Return a type the same as TYPE except unsigned or
    signed according to UNSIGNEDP.  */
 
 tree
-signed_or_unsigned_type (unsignedp, type)
+c_common_signed_or_unsigned_type (unsignedp, type)
      int unsignedp;
      tree type;
 {
@@ -1755,7 +1758,8 @@ shorten_compare (op0_ptr, op1_ptr, resty
       int unsignedp = TREE_UNSIGNED (*restype_ptr);
       tree val;
 
-      type = signed_or_unsigned_type (unsignedp0, TREE_TYPE (primop0));
+      type = c_common_signed_or_unsigned_type (unsignedp0,
+					       TREE_TYPE (primop0));
 
       /* If TYPE is an enumeration, then we need to get its min/max
 	 values from it's underlying integral type, not the enumerated
@@ -1767,7 +1771,7 @@ shorten_compare (op0_ptr, op1_ptr, resty
       minval = TYPE_MIN_VALUE (type);
 
       if (unsignedp && !unsignedp0)
-	*restype_ptr = signed_type (*restype_ptr);
+	*restype_ptr = c_common_signed_type (*restype_ptr);
 
       if (TREE_TYPE (primop1) != *restype_ptr)
 	primop1 = convert (*restype_ptr, primop1);
@@ -1864,7 +1868,7 @@ shorten_compare (op0_ptr, op1_ptr, resty
 	      default:
 		break;
 	      }
-	  type = unsigned_type (type);
+	  type = c_common_unsigned_type (type);
 	}
 
       if (!max_gt && !unsignedp0 && TREE_CODE (primop0) != INTEGER_CST)
@@ -1916,15 +1920,19 @@ shorten_compare (op0_ptr, op1_ptr, resty
 	   && TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (*restype_ptr))
     {
       type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1));
-      type = signed_or_unsigned_type (unsignedp0
-				      || TREE_UNSIGNED (*restype_ptr),
-				      type);
+      type = c_common_signed_or_unsigned_type (unsignedp0
+					       || TREE_UNSIGNED (*restype_ptr),
+					       type);
       /* Make sure shorter operand is extended the right way
 	 to match the longer operand.  */
-      primop0 = convert (signed_or_unsigned_type (unsignedp0, TREE_TYPE (primop0)),
-			 primop0);
-      primop1 = convert (signed_or_unsigned_type (unsignedp1, TREE_TYPE (primop1)),
-			 primop1);
+      primop0
+	= convert (c_common_signed_or_unsigned_type (unsignedp0,
+						     TREE_TYPE (primop0)),
+		   primop0);
+      primop1
+	= convert (c_common_signed_or_unsigned_type (unsignedp1,
+						     TREE_TYPE (primop1)),
+		   primop1);
     }
   else
     {
@@ -1947,7 +1955,7 @@ shorten_compare (op0_ptr, op1_ptr, resty
 		 so suppress the warning.  */
 	      if (extra_warnings && !in_system_header
 		  && ! (TREE_CODE (primop0) == INTEGER_CST
-			&& ! TREE_OVERFLOW (convert (signed_type (type),
+			&& ! TREE_OVERFLOW (convert (c_common_signed_type (type),
 						     primop0))))
 		warning ("comparison of unsigned expression >= 0 is always true");
 	      value = boolean_true_node;
@@ -1956,7 +1964,7 @@ shorten_compare (op0_ptr, op1_ptr, resty
 	    case LT_EXPR:
 	      if (extra_warnings && !in_system_header
 		  && ! (TREE_CODE (primop0) == INTEGER_CST
-			&& ! TREE_OVERFLOW (convert (signed_type (type),
+			&& ! TREE_OVERFLOW (convert (c_common_signed_type (type),
 						     primop0))))
 		warning ("comparison of unsigned expression < 0 is always false");
 	      value = boolean_false_node;
@@ -2366,7 +2374,7 @@ c_common_get_alias_set (t)
      variant as canonical.  */
   if (TREE_CODE (t) == INTEGER_TYPE && TREE_UNSIGNED (t))
     {
-      tree t1 = signed_type (t);
+      tree t1 = c_common_signed_type (t);
 
       /* t1 == t can happen for boolean nodes which are always unsigned.  */
       if (t1 != t)
@@ -2622,7 +2630,7 @@ c_common_nodes_and_builtins ()
      and this must agree, even if long and int are the same size.  */
   c_size_type_node =
     TREE_TYPE (identifier_global_value (get_identifier (SIZE_TYPE)));
-  signed_size_type_node = signed_type (c_size_type_node);
+  signed_size_type_node = c_common_signed_type (c_size_type_node);
   set_sizetype (c_size_type_node);
 
   build_common_tree_nodes_2 (flag_short_double);
@@ -2691,8 +2699,8 @@ c_common_nodes_and_builtins ()
     }
   else
     {
-      signed_wchar_type_node = signed_type (wchar_type_node);
-      unsigned_wchar_type_node = unsigned_type (wchar_type_node);
+      signed_wchar_type_node = c_common_signed_type (wchar_type_node);
+      unsigned_wchar_type_node = c_common_unsigned_type (wchar_type_node);
     }
 
   /* This is for wide string constants.  */
@@ -2710,7 +2718,7 @@ c_common_nodes_and_builtins ()
   default_function_type = build_function_type (integer_type_node, NULL_TREE);
   ptrdiff_type_node
     = TREE_TYPE (identifier_global_value (get_identifier (PTRDIFF_TYPE)));
-  unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
+  unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node);
 
   (*lang_hooks.decls.pushdecl)
     (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"),
============================================================
Index: gcc/c-common.h
--- gcc/c-common.h	2002/03/29 21:45:56	1.123
+++ gcc/c-common.h	2002/03/29 23:39:35
@@ -510,6 +510,9 @@ extern void c_common_insert_default_attr
 extern tree c_common_type_for_mode		PARAMS ((enum machine_mode,
 							 int));
 extern tree c_common_type_for_size		PARAMS ((unsigned int, int));
+extern tree c_common_unsigned_type		PARAMS ((tree));
+extern tree c_common_signed_type		PARAMS ((tree));
+extern tree c_common_signed_or_unsigned_type	PARAMS ((int, tree));
 extern void c_apply_type_quals_to_decl		PARAMS ((int, tree));
 extern tree c_sizeof				PARAMS ((tree));
 extern tree c_alignof				PARAMS ((tree));
============================================================
Index: gcc/c-decl.c
--- gcc/c-decl.c	2002/03/29 21:45:57	1.313
+++ gcc/c-decl.c	2002/03/29 23:39:53
@@ -4162,7 +4162,7 @@ grokdeclarator (declarator, declspecs, d
       else if (type == char_type_node)
 	type = unsigned_char_type_node;
       else if (typedef_decl)
-	type = unsigned_type (type);
+	type = c_common_unsigned_type (type);
       else
 	type = unsigned_type_node;
     }
@@ -4372,7 +4372,7 @@ grokdeclarator (declarator, declspecs, d
 	  tree itype = NULL_TREE;
 	  tree size = TREE_OPERAND (declarator, 1);
 	  /* The index is a signed object `sizetype' bits wide.  */
-	  tree index_type = signed_type (sizetype);
+	  tree index_type = c_common_signed_type (sizetype);
 
 	  array_ptr_quals = TREE_TYPE (declarator);
 	  array_parm_static = TREE_STATIC (declarator);
============================================================
Index: gcc/c-format.c
--- gcc/c-format.c	2002/02/20 22:54:32	1.17
+++ gcc/c-format.c	2002/03/29 23:39:57
@@ -2386,8 +2386,8 @@ check_format_types (status, types)
 	  && TREE_CODE (cur_type) == INTEGER_TYPE
 	  && (! pedantic || i == 0 || (i == 1 && char_type_flag))
 	  && (TREE_UNSIGNED (wanted_type)
-	      ? wanted_type == unsigned_type (cur_type)
-	      : wanted_type == signed_type (cur_type)))
+	      ? wanted_type == c_common_unsigned_type (cur_type)
+	      : wanted_type == c_common_signed_type (cur_type)))
 	continue;
       /* Likewise, "signed char", "unsigned char" and "char" are
 	 equivalent but the above test won't consider them equivalent.  */
============================================================
Index: gcc/c-lang.c
--- gcc/c-lang.c	2002/03/29 21:45:57	1.82
+++ gcc/c-lang.c	2002/03/29 23:39:59
@@ -84,6 +84,12 @@ static void c_post_options PARAMS ((void
 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
 
 /* ### When changing hooks, consider if ObjC needs changing too!! ### */
 
============================================================
Index: gcc/c-typeck.c
--- gcc/c-typeck.c	2002/03/29 21:45:58	1.187
+++ gcc/c-typeck.c	2002/03/29 23:40:13
@@ -2385,22 +2385,24 @@ build_binary_op (code, orig_op0, orig_op
 	      && unsigned0 == unsigned1
 	      && (unsigned0 || !uns))
 	    result_type
-	      = signed_or_unsigned_type (unsigned0,
-					 common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+	      = c_common_signed_or_unsigned_type
+	      (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
 	  else if (TREE_CODE (arg0) == INTEGER_CST
 		   && (unsigned1 || !uns)
 		   && (TYPE_PRECISION (TREE_TYPE (arg1))
 		       < TYPE_PRECISION (result_type))
-		   && (type = signed_or_unsigned_type (unsigned1,
-						       TREE_TYPE (arg1)),
+		   && (type
+		       = c_common_signed_or_unsigned_type (unsigned1,
+							   TREE_TYPE (arg1)),
 		       int_fits_type_p (arg0, type)))
 	    result_type = type;
 	  else if (TREE_CODE (arg1) == INTEGER_CST
 		   && (unsigned0 || !uns)
 		   && (TYPE_PRECISION (TREE_TYPE (arg0))
 		       < TYPE_PRECISION (result_type))
-		   && (type = signed_or_unsigned_type (unsigned0,
-						       TREE_TYPE (arg0)),
+		   && (type
+		       = c_common_signed_or_unsigned_type (unsigned0,
+							   TREE_TYPE (arg0)),
 		       int_fits_type_p (arg1, type)))
 	    result_type = type;
 	}
@@ -2426,7 +2428,8 @@ build_binary_op (code, orig_op0, orig_op
 	    {
 	      /* Do an unsigned shift if the operand was zero-extended.  */
 	      result_type
-		= signed_or_unsigned_type (unsigned_arg, TREE_TYPE (arg0));
+		= c_common_signed_or_unsigned_type (unsigned_arg,
+						    TREE_TYPE (arg0));
 	      /* Convert value-to-be-shifted to that type.  */
 	      if (TREE_TYPE (op0) != result_type)
 		op0 = convert (result_type, op0);
@@ -2504,15 +2507,17 @@ build_binary_op (code, orig_op0, orig_op
 		     would fit in the result if the result were signed.  */
 		  else if (TREE_CODE (uop) == INTEGER_CST
 			   && (resultcode == EQ_EXPR || resultcode == NE_EXPR)
-			   && int_fits_type_p (uop, signed_type (result_type)))
+			   && int_fits_type_p
+			   (uop, c_common_signed_type (result_type)))
 		    /* OK */;
 		  /* Do not warn if the unsigned quantity is an enumeration
 		     constant and its maximum value would fit in the result
 		     if the result were signed.  */
 		  else if (TREE_CODE (uop) == INTEGER_CST
 			   && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE
-			   && int_fits_type_p (TYPE_MAX_VALUE (TREE_TYPE(uop)),
-					       signed_type (result_type)))
+			   && int_fits_type_p
+			   (TYPE_MAX_VALUE (TREE_TYPE(uop)),
+			    c_common_signed_type (result_type)))
 		    /* OK */;
 		  else
 		    warning ("comparison between signed and unsigned");
@@ -4161,8 +4166,8 @@ convert_for_assignment (type, rhs, errty
 	 Meanwhile, the lhs target must have all the qualifiers of the rhs.  */
       if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
 	  || comp_target_types (type, rhstype)
-	  || (unsigned_type (TYPE_MAIN_VARIANT (ttl))
-	      == unsigned_type (TYPE_MAIN_VARIANT (ttr))))
+	  || (c_common_unsigned_type (TYPE_MAIN_VARIANT (ttl))
+	      == c_common_unsigned_type (TYPE_MAIN_VARIANT (ttr))))
 	{
 	  if (pedantic
 	      && ((VOID_TYPE_P (ttl) && TREE_CODE (ttr) == FUNCTION_TYPE)
============================================================
Index: gcc/convert.c
--- gcc/convert.c	2002/03/29 21:45:58	1.16
+++ gcc/convert.c	2002/03/29 23:40:14
@@ -316,10 +316,12 @@ convert_to_integer (type, expr)
 		       unsigned then can safely do the work as unsigned.
 		       And we may need to do it as unsigned
 		       if we truncate to the original size.  */
-		    typex = ((TREE_UNSIGNED (TREE_TYPE (expr))
-			      || (TREE_UNSIGNED (TREE_TYPE (arg0))
-				  && TREE_UNSIGNED (TREE_TYPE (arg1))))
-			     ? unsigned_type (typex) : signed_type (typex));
+		    if (TREE_UNSIGNED (TREE_TYPE (expr))
+			|| (TREE_UNSIGNED (TREE_TYPE (arg0))
+			    && TREE_UNSIGNED (TREE_TYPE (arg1))))
+		      typex = (*lang_hooks.types.unsigned_type) (typex);
+		    else
+		      typex = (*lang_hooks.types.signed_type) (typex);
 		    return convert (type,
 				    fold (build (ex_form, typex,
 						 convert (typex, arg0),
@@ -350,8 +352,10 @@ convert_to_integer (type, expr)
 	      {
 		/* Don't do unsigned arithmetic where signed was wanted,
 		   or vice versa.  */
-		typex = (TREE_UNSIGNED (TREE_TYPE (expr))
-			 ? unsigned_type (typex) : signed_type (typex));
+		if (TREE_UNSIGNED (TREE_TYPE (expr)))
+		  typex = (*lang_hooks.types.unsigned_type) (typex);
+		else
+		  typex = (*lang_hooks.types.signed_type) (typex);
 		return convert (type,
 				fold (build1 (ex_form, typex,
 					      convert (typex,
============================================================
Index: gcc/expmed.c
--- gcc/expmed.c	2002/03/29 21:45:59	1.114
+++ gcc/expmed.c	2002/03/29 23:40:27
@@ -4108,21 +4108,22 @@ make_tree (type, x)
 			  make_tree (type, XEXP (x, 1))));
 
     case LSHIFTRT:
+      t = (*lang_hooks.types.unsigned_type) (type);
       return fold (convert (type,
-			    build (RSHIFT_EXPR, unsigned_type (type),
-				   make_tree (unsigned_type (type),
-					      XEXP (x, 0)),
+			    build (RSHIFT_EXPR, t,
+				   make_tree (t, XEXP (x, 0)),
 				   make_tree (type, XEXP (x, 1)))));
 
     case ASHIFTRT:
+      t = (*lang_hooks.types.unsigned_type) (type);
       return fold (convert (type,
-			    build (RSHIFT_EXPR, signed_type (type),
-				   make_tree (signed_type (type), XEXP (x, 0)),
+			    build (RSHIFT_EXPR, t,
+				   make_tree (t, XEXP (x, 0)),
 				   make_tree (type, XEXP (x, 1)))));
 
     case DIV:
       if (TREE_CODE (type) != REAL_TYPE)
-	t = signed_type (type);
+	t = (*lang_hooks.types.signed_type) (type);
       else
 	t = type;
 
@@ -4131,7 +4132,7 @@ make_tree (type, x)
 				   make_tree (t, XEXP (x, 0)),
 				   make_tree (t, XEXP (x, 1)))));
     case UDIV:
-      t = unsigned_type (type);
+      t = (*lang_hooks.types.unsigned_type) (type);
       return fold (convert (type,
 			    build (TRUNC_DIV_EXPR, t,
 				   make_tree (t, XEXP (x, 0)),
============================================================
Index: gcc/expr.c
--- gcc/expr.c	2002/03/29 21:45:59	1.439
+++ gcc/expr.c	2002/03/29 23:40:48
@@ -4021,11 +4021,9 @@ store_expr (exp, target, want_value)
 	{
 	  if (TREE_UNSIGNED (TREE_TYPE (exp))
 	      != SUBREG_PROMOTED_UNSIGNED_P (target))
-	    exp
-	      = convert
-		(signed_or_unsigned_type (SUBREG_PROMOTED_UNSIGNED_P (target),
-					  TREE_TYPE (exp)),
-		 exp);
+	    exp = convert
+	      ((*lang_hooks.types.signed_or_unsigned_type)
+	       (SUBREG_PROMOTED_UNSIGNED_P (target), TREE_TYPE (exp)), exp);
 
 	  exp = convert ((*lang_hooks.types.type_for_mode)
 			 (GET_MODE (SUBREG_REG (target)),
============================================================
Index: gcc/fold-const.c
--- gcc/fold-const.c	2002/03/29 21:46:00	1.192
+++ gcc/fold-const.c	2002/03/29 23:41:03
@@ -1937,9 +1937,8 @@ operand_equal_for_comparison_p (arg0, ar
 
       /* Make sure shorter operand is extended the right way
 	 to match the longer operand.  */
-      primarg1 = convert (signed_or_unsigned_type (unsignedp1,
-						   TREE_TYPE (primarg1)),
-			  primarg1);
+      primarg1 = convert ((*lang_hooks.types.signed_or_unsigned_type)
+			  (unsignedp1, TREE_TYPE (primarg1)), primarg1);
 
       if (operand_equal_p (arg0, convert (type, primarg1), 0))
 	return 1;
@@ -2622,7 +2621,7 @@ all_ones_mask_p (mask, size)
   tree tmask;
 
   tmask = build_int_2 (~0, ~0);
-  TREE_TYPE (tmask) = signed_type (type);
+  TREE_TYPE (tmask) = (*lang_hooks.types.signed_type) (type);
   force_fit_type (tmask, 0);
   return
     tree_int_cst_equal (mask,
@@ -3063,7 +3062,7 @@ build_range_check (type, exp, in_p, low,
 
   else if (integer_zerop (low))
     {
-      utype = unsigned_type (etype);
+      utype = (*lang_hooks.types.unsigned_type) (etype);
       return build_range_check (type, convert (utype, exp), 1, 0,
 				convert (utype, high));
     }
@@ -3316,7 +3315,7 @@ unextend (c, p, unsignedp, mask)
      zero or one, and the conversion to a signed type can never overflow.
      We could get an overflow if this conversion is done anywhere else.  */
   if (TREE_UNSIGNED (type))
-    temp = convert (signed_type (type), temp);
+    temp = convert ((*lang_hooks.types.signed_type) (type), temp);
 
   temp = const_binop (LSHIFT_EXPR, temp, size_int (modesize - 1), 0);
   temp = const_binop (RSHIFT_EXPR, temp, size_int (modesize - p - 1), 0);
@@ -5939,7 +5938,7 @@ fold (expr)
 	      || TREE_CODE (arg0) == ROUND_MOD_EXPR)
 	  && integer_pow2p (TREE_OPERAND (arg0, 1)))
 	{
-	  tree newtype = unsigned_type (TREE_TYPE (arg0));
+	  tree newtype = (*lang_hooks.types.unsigned_type) (TREE_TYPE (arg0));
 	  tree newmod = build (TREE_CODE (arg0), newtype,
 			       convert (newtype, TREE_OPERAND (arg0, 0)),
 			       convert (newtype, TREE_OPERAND (arg0, 1)));
@@ -6114,25 +6113,18 @@ fold (expr)
 		     && TREE_UNSIGNED (TREE_TYPE (arg1))
 		     /* signed_type does not work on pointer types.  */
 		     && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
-	      switch (TREE_CODE (t))
-		{
-		case LE_EXPR:
-		  return fold (build (GE_EXPR, type,
-				      convert (signed_type (TREE_TYPE (arg0)),
-					       arg0),
-				      convert (signed_type (TREE_TYPE (arg1)),
-					       integer_zero_node)));
-		case GT_EXPR:
-		  return fold (build (LT_EXPR, type,
-				      convert (signed_type (TREE_TYPE (arg0)),
-					       arg0),
-				      convert (signed_type (TREE_TYPE (arg1)),
-					       integer_zero_node)));
-
-		default:
-		  break;
-		}
-
+	      {
+		if (TREE_CODE (t) == LE_EXPR && TREE_CODE (t) == GT_EXPR)
+		  {
+		    tree st0, st1;
+		    st0 = (*lang_hooks.types.signed_type) (TREE_TYPE (arg0));
+		    st1 = (*lang_hooks.types.signed_type) (TREE_TYPE (arg1));
+		    return fold
+		      (build (TREE_CODE (t) == LE_EXPR ? GE_EXPR: LT_EXPR,
+			      type, convert (st0, arg0),
+			      convert (st1, integer_zero_node)));
+		  }
+	      }
             else if (TREE_INT_CST_HIGH (arg1) == 0
 		     && (TREE_INT_CST_LOW (arg1)
 			 == ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1)
@@ -6506,14 +6498,16 @@ fold (expr)
 	      case GE_EXPR:
 	      case GT_EXPR:
 		if (TREE_UNSIGNED (TREE_TYPE (arg1)))
-		  arg1 = convert (signed_type (TREE_TYPE (arg1)), arg1);
+		  arg1 = convert ((*lang_hooks.types.signed_type)
+				  (TREE_TYPE (arg1)), arg1);
 		return pedantic_non_lvalue
 		  (convert (type, fold (build1 (ABS_EXPR,
 						TREE_TYPE (arg1), arg1))));
 	      case LE_EXPR:
 	      case LT_EXPR:
 		if (TREE_UNSIGNED (TREE_TYPE (arg1)))
-		  arg1 = convert (signed_type (TREE_TYPE (arg1)), arg1);
+		  arg1 = convert ((lang_hooks.types.signed_type)
+				  (TREE_TYPE (arg1)), arg1);
 		return pedantic_non_lvalue
 		  (negate_expr (convert (type,
 					 fold (build1 (ABS_EXPR,
============================================================
Index: gcc/langhooks.h
--- gcc/langhooks.h	2002/03/29 21:46:01	1.27
+++ gcc/langhooks.h	2002/03/29 23:41:04
@@ -82,6 +82,18 @@ struct lang_hooks_for_types
   /* Given PRECISION and UNSIGNEDP, return a suitable type-tree for an
      integer type with at least that precision.  */
   tree (*type_for_size) PARAMS ((unsigned, int));
+
+  /* Given an integer type T, return a type like T but unsigned.
+     If T is unsigned, the value is T.  */
+  tree (*unsigned_type) PARAMS ((tree));
+
+  /* Given an integer type T, return a type like T but signed.
+     If T is signed, the value is T.  */
+  tree (*signed_type) PARAMS ((tree));
+
+  /* Return a type the same as TYPE except unsigned or signed
+     according to UNSIGNEDP.  */
+  tree (*signed_or_unsigned_type) PARAMS ((int, tree));
 };
 
 /* Language hooks related to decls and the symbol table.  */
============================================================
Index: gcc/tree.h
--- gcc/tree.h	2002/03/29 21:46:03	1.321
+++ gcc/tree.h	2002/03/29 23:41:13
@@ -2125,7 +2125,6 @@ extern tree make_signed_type		PARAMS ((i
 extern tree make_unsigned_type		PARAMS ((int));
 extern void initialize_sizetypes	PARAMS ((void));
 extern void set_sizetype		PARAMS ((tree));
-extern tree signed_or_unsigned_type 	PARAMS ((int, tree));
 extern void fixup_unsigned_type		PARAMS ((tree));
 extern tree build_pointer_type		PARAMS ((tree));
 extern tree build_reference_type 	PARAMS ((tree));
@@ -2610,20 +2609,6 @@ extern tree get_unwidened		PARAMS ((tree
    or 0 if the value should be sign-extended.  */
 
 extern tree get_narrower		PARAMS ((tree, int *));
-
-/* Given an integer type T, return a type like T but unsigned.
-   If T is unsigned, the value is T.
-   The definition of this resides in language-specific code
-   as the repertoire of available types may vary.  */
-
-extern tree unsigned_type		PARAMS ((tree));
-
-/* Given an integer type T, return a type like T but signed.
-   If T is signed, the value is T.
-   The definition of this resides in language-specific code
-   as the repertoire of available types may vary.  */
-
-extern tree signed_type			PARAMS ((tree));
 
 /* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
    look for nested component-refs or array-refs at constant positions
============================================================
Index: gcc/ada/gigi.h
--- gcc/ada/gigi.h	2002/03/29 21:46:20	1.7
+++ gcc/ada/gigi.h	2002/03/29 23:41:17
@@ -430,14 +430,14 @@ extern tree gnat_type_for_size		PARAMS (
 extern tree gnat_type_for_mode		PARAMS ((enum machine_mode, int));
 
 /* Return the unsigned version of a TYPE_NODE, a scalar type.  */
-extern tree unsigned_type		PARAMS ((tree));
+extern tree gnat_unsigned_type		PARAMS ((tree));
 
 /* Return the signed version of a TYPE_NODE, a scalar type.  */
-extern tree signed_type			PARAMS ((tree));
+extern tree gnat_signed_type		PARAMS ((tree));
 
 /* Return a type the same as TYPE except unsigned or signed according to
    UNSIGNEDP.  */
-extern tree signed_or_unsigned_type	PARAMS ((int, tree));
+extern tree gnat_signed_or_unsigned_type PARAMS ((int, tree));
 
 /* This routine is called in tree.c to print an error message for invalid use
    of an incomplete type.  */
============================================================
Index: gcc/ada/misc.c
--- gcc/ada/misc.c	2002/03/29 21:46:20	1.31
+++ gcc/ada/misc.c	2002/03/29 23:41:19
@@ -122,6 +122,12 @@ static rtx gnat_expand_expr		PARAMS ((tr
 #define LANG_HOOKS_TYPE_FOR_MODE	gnat_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE	gnat_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE		gnat_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE	gnat_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE gnat_signed_or_unsigned_type
 
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
============================================================
Index: gcc/ada/trans.c
--- gcc/ada/trans.c	2002/03/29 21:46:20	1.14
+++ gcc/ada/trans.c	2002/03/29 23:41:32
@@ -1348,7 +1348,7 @@ tree_transform (gnat_node)
 		/* 'Length or 'Range_Length.  */
 		{
 		  tree gnu_compute_type
-		    = signed_or_unsigned_type
+		    = gnat_signed_or_unsigned_type
 		      (0, get_base_type (gnu_result_type));
 
 		  gnu_result
@@ -1867,10 +1867,10 @@ tree_transform (gnat_node)
 	   so we may need to choose a different type.  */
 	if (Nkind (gnat_node) == N_Op_Shift_Right
 	    && ! TREE_UNSIGNED (gnu_type))
-	  gnu_type = unsigned_type (gnu_type);
+	  gnu_type = gnat_unsigned_type (gnu_type);
 	else if (Nkind (gnat_node) == N_Op_Shift_Right_Arithmetic
 		 && TREE_UNSIGNED (gnu_type))
-	  gnu_type = signed_type (gnu_type);
+	  gnu_type = gnat_signed_type (gnu_type);
 
 	if (gnu_type != gnu_result_type)
 	  {
@@ -4674,17 +4674,17 @@ convert_with_check (gnat_type, gnu_expr,
 	 comparing them properly.  Likewise, convert the upper bounds
 	 to unsigned types.  */
       if (INTEGRAL_TYPE_P (gnu_in_basetype) && TREE_UNSIGNED (gnu_in_basetype))
-	gnu_in_lb = convert (signed_type (gnu_in_basetype), gnu_in_lb);
+	gnu_in_lb = convert (gnat_signed_type (gnu_in_basetype), gnu_in_lb);
 
       if (INTEGRAL_TYPE_P (gnu_in_basetype)
 	  && ! TREE_UNSIGNED (gnu_in_basetype))
-	gnu_in_ub = convert (unsigned_type (gnu_in_basetype), gnu_in_ub);
+	gnu_in_ub = convert (gnat_unsigned_type (gnu_in_basetype), gnu_in_ub);
 
       if (INTEGRAL_TYPE_P (gnu_base_type) && TREE_UNSIGNED (gnu_base_type))
-	gnu_out_lb = convert (signed_type (gnu_base_type), gnu_out_lb);
+	gnu_out_lb = convert (gnat_signed_type (gnu_base_type), gnu_out_lb);
 
       if (INTEGRAL_TYPE_P (gnu_base_type) && ! TREE_UNSIGNED (gnu_base_type))
-	gnu_out_ub = convert (unsigned_type (gnu_base_type), gnu_out_ub);
+	gnu_out_ub = convert (gnat_unsigned_type (gnu_base_type), gnu_out_ub);
 
       /* Check each bound separately and only if the result bound
 	 is tighter than the bound on the input type.  Note that all the
============================================================
Index: gcc/ada/utils.c
--- gcc/ada/utils.c	2002/03/29 21:46:20	1.12
+++ gcc/ada/utils.c	2002/03/29 23:41:40
@@ -2028,7 +2028,7 @@ gnat_type_for_mode (mode, unsignedp)
 /* Return the unsigned version of a TYPE_NODE, a scalar type.  */
 
 tree
-unsigned_type (type_node)
+gnat_unsigned_type (type_node)
      tree type_node;
 {
   tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1);
@@ -2052,7 +2052,7 @@ unsigned_type (type_node)
 /* Return the signed version of a TYPE_NODE, a scalar type.  */
 
 tree
-signed_type (type_node)
+gnat_signed_type (type_node)
      tree type_node;
 {
   tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 0);
@@ -2077,7 +2077,7 @@ signed_type (type_node)
    UNSIGNEDP.  */
 
 tree
-signed_or_unsigned_type (unsignedp, type)
+gnat_signed_or_unsigned_type (unsignedp, type)
      int unsignedp;
      tree type;
 {
============================================================
Index: gcc/cp/cp-lang.c
--- gcc/cp/cp-lang.c	2002/03/29 21:46:21	1.21
+++ gcc/cp/cp-lang.c	2002/03/29 23:41:40
@@ -115,6 +115,12 @@ static bool ok_to_generate_alias_set_for
 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
 
 /* Each front end provides its own hooks, for toplev.c.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
============================================================
Index: gcc/cp/decl.c
--- gcc/cp/decl.c	2002/03/29 21:46:21	1.885
+++ gcc/cp/decl.c	2002/03/29 23:42:14
@@ -10325,7 +10325,7 @@ grokdeclarator (declarator, declspecs, d
       else if (type == char_type_node)
 	type = unsigned_char_type_node;
       else if (typedef_decl)
-	type = unsigned_type (type);
+	type = c_common_unsigned_type (type);
       else
 	type = unsigned_type_node;
     }
============================================================
Index: gcc/cp/mangle.c
--- gcc/cp/mangle.c	2002/03/29 21:46:22	1.49
+++ gcc/cp/mangle.c	2002/03/29 23:42:20
@@ -1111,7 +1111,7 @@ write_integer_cst (cst)
 	  chunk *= chunk;
 	}
       
-      type = signed_or_unsigned_type (1, TREE_TYPE (cst));
+      type = c_common_signed_or_unsigned_type (1, TREE_TYPE (cst));
       base = build_int_2 (chunk, 0);
       n = build_int_2 (TREE_INT_CST_LOW (cst), TREE_INT_CST_HIGH (cst));
       TREE_TYPE (n) = TREE_TYPE (base) = type;
============================================================
Index: gcc/cp/typeck.c
--- gcc/cp/typeck.c	2002/03/29 21:46:22	1.394
+++ gcc/cp/typeck.c	2002/03/29 23:42:36
@@ -3782,24 +3782,22 @@ build_binary_op (code, orig_op0, orig_op
 		  == TYPE_PRECISION (TREE_TYPE (arg0)))
 	      && unsigned0 == unsigned1
 	      && (unsigned0 || !uns))
-	    result_type
-	      = signed_or_unsigned_type (unsigned0,
-					 common_type (TREE_TYPE (arg0),
-						      TREE_TYPE (arg1)));
+	    result_type = c_common_signed_or_unsigned_type
+	      (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
 	  else if (TREE_CODE (arg0) == INTEGER_CST
 		   && (unsigned1 || !uns)
 		   && (TYPE_PRECISION (TREE_TYPE (arg1))
 		       < TYPE_PRECISION (result_type))
-		   && (type = signed_or_unsigned_type (unsigned1,
-						       TREE_TYPE (arg1)),
+		   && (type = c_common_signed_or_unsigned_type
+		       (unsigned1, TREE_TYPE (arg1)),
 		       int_fits_type_p (arg0, type)))
 	    result_type = type;
 	  else if (TREE_CODE (arg1) == INTEGER_CST
 		   && (unsigned0 || !uns)
 		   && (TYPE_PRECISION (TREE_TYPE (arg0))
 		       < TYPE_PRECISION (result_type))
-		   && (type = signed_or_unsigned_type (unsigned0,
-						       TREE_TYPE (arg0)),
+		   && (type = c_common_signed_or_unsigned_type
+		       (unsigned0, TREE_TYPE (arg0)),
 		       int_fits_type_p (arg1, type)))
 	    result_type = type;
 	}
@@ -3834,8 +3832,8 @@ build_binary_op (code, orig_op0, orig_op
 	    {
 	      /* Do an unsigned shift if the operand was zero-extended.  */
 	      result_type
-		= signed_or_unsigned_type (unsigned_arg,
-					   TREE_TYPE (arg0));
+		= c_common_signed_or_unsigned_type (unsigned_arg,
+						    TREE_TYPE (arg0));
 	      /* Convert value-to-be-shifted to that type.  */
 	      if (TREE_TYPE (op0) != result_type)
 		op0 = cp_convert (result_type, op0);
@@ -3908,11 +3906,11 @@ build_binary_op (code, orig_op0, orig_op
 	     not use the most significant bit of result_type.  */
 	  else if ((resultcode == EQ_EXPR || resultcode == NE_EXPR)
 		   && ((op0_signed && TREE_CODE (orig_op1) == INTEGER_CST
-			&& int_fits_type_p (orig_op1,
-					    signed_type (result_type)))
+			&& int_fits_type_p (orig_op1, c_common_signed_type
+					    (result_type)))
 			|| (op1_signed && TREE_CODE (orig_op0) == INTEGER_CST
-			    && int_fits_type_p (orig_op0,
-						signed_type (result_type)))))
+			    && int_fits_type_p (orig_op0, c_common_signed_type
+						(result_type)))))
 	    /* OK */;
 	  else
 	    warning ("comparison between signed and unsigned integer expressions");
============================================================
Index: gcc/f/com.c
--- gcc/f/com.c	2002/03/29 21:46:25	1.163
+++ gcc/f/com.c	2002/03/29 23:43:05
@@ -263,6 +263,9 @@ struct _ffecom_concat_list_
 
 static tree ffe_type_for_mode PARAMS ((enum machine_mode, int));
 static tree ffe_type_for_size PARAMS ((unsigned int, int));
+static tree ffe_unsigned_type PARAMS ((tree));
+static tree ffe_signed_type PARAMS ((tree));
+static tree ffe_signed_or_unsigned_type PARAMS ((int, tree));
 static void ffecom_init_decl_processing PARAMS ((void));
 static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
 static tree ffecom_widest_expr_type_ (ffebld list);
@@ -14227,10 +14230,17 @@ static void ffe_mark_tree (tree);
 #define LANG_HOOKS_PRINT_IDENTIFIER	ffe_print_identifier
 #undef  LANG_HOOKS_DECL_PRINTABLE_NAME
 #define LANG_HOOKS_DECL_PRINTABLE_NAME	ffe_printable_name
+
 #undef  LANG_HOOKS_TYPE_FOR_MODE
 #define LANG_HOOKS_TYPE_FOR_MODE	ffe_type_for_mode
 #undef  LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE	ffe_type_for_size
+#undef  LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE		ffe_signed_type
+#undef  LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE	ffe_unsigned_type
+#undef  LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE ffe_signed_or_unsigned_type
 
 /* We do not wish to use alias-set based aliasing at all.  Used in the
    extreme (every object with its own set, with equivalences recorded) it
@@ -14743,8 +14753,8 @@ set_block (block)
 					   BLOCK_SUBBLOCKS (block));
 }
 
-tree
-signed_or_unsigned_type (unsignedp, type)
+static tree
+ffe_signed_or_unsigned_type (unsignedp, type)
      int unsignedp;
      tree type;
 {
@@ -14771,8 +14781,8 @@ signed_or_unsigned_type (unsignedp, type
   return type2;
 }
 
-tree
-signed_type (type)
+static tree
+ffe_signed_type (type)
      tree type;
 {
   tree type1 = TYPE_MAIN_VARIANT (type);
@@ -15091,8 +15101,8 @@ ffe_type_for_size (bits, unsignedp)
   return 0;
 }
 
-tree
-unsigned_type (type)
+static tree
+ffe_unsigned_type (type)
      tree type;
 {
   tree type1 = TYPE_MAIN_VARIANT (type);
============================================================
Index: gcc/java/expr.c
--- gcc/java/expr.c	2002/03/27 23:12:05	1.141
+++ gcc/java/expr.c	2002/03/29 23:43:13
@@ -1395,7 +1395,7 @@ build_java_binop (op, type, arg1, arg2)
     {
     case URSHIFT_EXPR:
       {
-	tree u_type = unsigned_type (type);
+	tree u_type = java_unsigned_type (type);
 	arg1 = convert (u_type, arg1);
 	arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2);
 	return convert (type, arg1);
============================================================
Index: gcc/java/java-tree.h
--- gcc/java/java-tree.h	2002/03/29 21:46:26	1.143
+++ gcc/java/java-tree.h	2002/03/29 23:43:18
@@ -1041,6 +1041,9 @@ extern void java_parse_file PARAMS ((voi
 extern void java_mark_tree PARAMS ((tree));
 extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
 extern tree java_type_for_size PARAMS ((unsigned int, int));
+extern tree java_unsigned_type PARAMS ((tree));
+extern tree java_signed_type PARAMS ((tree));
+extern tree java_signed_or_unsigned_type PARAMS ((int, tree));
 extern void add_assume_compiled PARAMS ((const char *, int));
 extern tree lookup_class PARAMS ((tree));
 extern tree lookup_java_constructor PARAMS ((tree, tree));
============================================================
Index: gcc/java/lang.c
--- gcc/java/lang.c	2002/03/29 21:46:26	1.95
+++ gcc/java/lang.c	2002/03/29 23:43:19
@@ -231,10 +231,17 @@ static int dependency_tracking = 0;
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
 #define LANG_HOOKS_DECL_PRINTABLE_NAME lang_printable_name
+
 #undef LANG_HOOKS_TYPE_FOR_MODE
 #define LANG_HOOKS_TYPE_FOR_MODE java_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE java_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE java_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE java_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE java_signed_or_unsigned_type
 
 /* Each front end provides its own.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
============================================================
Index: gcc/java/parse.y
--- gcc/java/parse.y	2002/03/29 22:27:29	1.369
+++ gcc/java/parse.y	2002/03/29 23:43:54
@@ -13402,7 +13402,7 @@ patch_binop (node, wfl_op1, wfl_op2)
       if (code == URSHIFT_EXPR && ! flag_emit_class_files)
 	{
 	  tree to_return;
-          tree utype = unsigned_type (prom_type);
+          tree utype = java_unsigned_type (prom_type);
           op1 = convert (utype, op1);
 	  TREE_SET_CODE (node, RSHIFT_EXPR);
           TREE_OPERAND (node, 0) = op1;
============================================================
Index: gcc/java/typeck.c
--- gcc/java/typeck.c	2002/03/29 21:46:26	1.45
+++ gcc/java/typeck.c	2002/03/29 23:43:57
@@ -226,7 +226,7 @@ java_type_for_size (bits, unsignedp)
    signed according to UNSIGNEDP.  */
 
 tree
-signed_or_unsigned_type (unsignedp, type)
+java_signed_or_unsigned_type (unsignedp, type)
      int unsignedp;
      tree type;
 {
@@ -246,20 +246,19 @@ signed_or_unsigned_type (unsignedp, type
 /* Return a signed type the same as TYPE in other respects.  */
 
 tree
-signed_type (type)
+java_signed_type (type)
      tree type;
 {
-  return signed_or_unsigned_type (0, type);
+  return java_signed_or_unsigned_type (0, type);
 }
 
 /* Return an unsigned type the same as TYPE in other respects.  */
 
 tree
-unsigned_type (type)
+java_unsigned_type (type)
      tree type;
 {
-  return signed_or_unsigned_type (1, type);
-
+  return java_signed_or_unsigned_type (1, type);
 }
 
 /* Mark EXP saying that we need to be able to take the
============================================================
Index: gcc/objc/objc-lang.c
--- gcc/objc/objc-lang.c	2002/03/29 21:46:27	1.11
+++ gcc/objc/objc-lang.c	2002/03/29 23:43:57
@@ -80,6 +80,12 @@ static void objc_post_options           
 #define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
 #define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
 
 /* Each front end provides its own hooks, for toplev.c.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]