OSDN Git Service

gcc/
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 May 2007 14:37:17 +0000 (14:37 +0000)
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 May 2007 14:37:17 +0000 (14:37 +0000)
       * c-common.c (warnings_for_convert_and_check): Use unsigned_type_for
       instead of c_common_unsigned_type.
       (c_common_unsigned_type): Remove.
       (shorten_compare): Use c_common_signed_or_unsigned_type instead of
       c_common_unsigned_type.
       (c_common_nodes_and_builtins): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-common.h (c_common_unsigned_type): Remove.
       * c-decl.c (grokdeclarator): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-format.c (check_format_types): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * c-objc-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * c-typeck.c (convert_for_assignment): Use unsigned_type_for instead of
       c_common_unsigned_type.
       * convert.c (convert_to_integer): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       * expmed.c (make_tree): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       * fold-const.c (fold_negate_expr): Use unsigned_type_for instead of
       lang_hooks.types.unsigned_type.
       (build_range_check): Likewise.
       (fold_unary): Likewise.
       (fold_binary): Likewise.
       (fold_ternary): Likewise.
       * langhooks-def.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * langhooks.h (lang_hooks_for_types): Remove unsigned_type.
       * tree.c (get_unsigned_type): New.
       (unsigned_type_for): Use get_unsigned_type instead of
       lang_hooks.types.unsigned_type

gcc/ada
       * misc.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.

gcc/cp
       * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * decl.c (grokdeclarator): Use unsigned_type_for instead of
       c_common_unsigned_type.

gcc/fortran
       * f95-lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use unsigned_type_for
       instead of gfc_unsigned_type.
       * trans-stmt.c (gfc_trans_do): Use unsigned_type_for instead of
       gfc_unsigned_type.
       * trans-types.c (gfc_unsigned_type): Remove.
       * trans-types.h (gfc_unsigned_type): Remove.

gcc/java
       * expr.c (build_java_binop): Use unsigned_type_for instead of
       java_unsigned_type.
       * java-tree.h (java_unsigned_type): Remove.
       * lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
       * typeck.c (java_unsigned_type): Remove.

gcc/treelang
       * treetree.c (tree_lang_unsigned_type): Remove.
       (LANG_HOOKS_UNSIGNED_TYPE): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124715 138bc75d-0d04-0410-961f-82ee72b054a4

31 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/misc.c
gcc/c-common.c
gcc/c-common.h
gcc/c-decl.c
gcc/c-format.c
gcc/c-objc-common.h
gcc/c-typeck.c
gcc/convert.c
gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.h
gcc/cp/decl.c
gcc/expmed.c
gcc/fold-const.c
gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/fortran/trans-intrinsic.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans-types.c
gcc/fortran/trans-types.h
gcc/java/ChangeLog
gcc/java/expr.c
gcc/java/java-tree.h
gcc/java/lang.c
gcc/java/typeck.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/tree.c
gcc/treelang/ChangeLog
gcc/treelang/treetree.c

index d470dab..37ba76e 100644 (file)
@@ -1,3 +1,36 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * c-common.c (warnings_for_convert_and_check): Use unsigned_type_for
+       instead of c_common_unsigned_type.
+       (c_common_unsigned_type): Remove.
+       (shorten_compare): Use c_common_signed_or_unsigned_type instead of
+       c_common_unsigned_type.
+       (c_common_nodes_and_builtins): Use unsigned_type_for instead of
+       c_common_unsigned_type.
+       * c-common.h (c_common_unsigned_type): Remove.
+       * c-decl.c (grokdeclarator): Use unsigned_type_for instead of
+       c_common_unsigned_type.
+       * c-format.c (check_format_types): Use unsigned_type_for instead of
+       c_common_unsigned_type.
+       * c-objc-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+       * c-typeck.c (convert_for_assignment): Use unsigned_type_for instead of
+       c_common_unsigned_type.
+       * convert.c (convert_to_integer): Use unsigned_type_for instead of
+       lang_hooks.types.unsigned_type.
+       * expmed.c (make_tree): Use unsigned_type_for instead of
+       lang_hooks.types.unsigned_type.
+       * fold-const.c (fold_negate_expr): Use unsigned_type_for instead of
+       lang_hooks.types.unsigned_type.
+       (build_range_check): Likewise.
+       (fold_unary): Likewise.
+       (fold_binary): Likewise.
+       (fold_ternary): Likewise.
+       * langhooks-def.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+       * langhooks.h (lang_hooks_for_types): Remove unsigned_type.
+       * tree.c (get_unsigned_type): New.
+       (unsigned_type_for): Use get_unsigned_type instead of
+       lang_hooks.types.unsigned_type.
+
 2007-05-14  Kazu Hirata  <kazu@codesourcery.com>
 
        * config/m68k/m68k-protos.h: Rename m68k_interrupt_function_p
index e85a5a0..fc5337d 100644 (file)
@@ -1,3 +1,7 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * misc.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+
 2007-05-02  Pascal Obry  <obry@adacore.com>
 
        * gnatchop.adb (Write_Source_Reference_Pragma): Change implementation
index 7d4ffde..db39179 100644 (file)
@@ -159,8 +159,6 @@ static tree gnat_type_max_size              (tree);
 #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_ATTRIBUTE_TABLE
 #define LANG_HOOKS_ATTRIBUTE_TABLE     gnat_internal_attribute_table
 #undef  LANG_HOOKS_BUILTIN_FUNCTION
index 17a0067..d132be9 100644 (file)
@@ -1330,7 +1330,7 @@ warnings_for_convert_and_check (tree type, tree expr, tree result)
           else if (warn_conversion)
             conversion_warning (type, expr);
         }
-      else if (!int_fits_type_p (expr, c_common_unsigned_type (type))) 
+      else if (!int_fits_type_p (expr, unsigned_type_for (type))) 
        warning (OPT_Woverflow,
                 "overflow in implicit constant conversion");
       /* No warning for converting 0x80000000 to int.  */
@@ -2025,39 +2025,6 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
   return 0;
 }
 
-/* Return an unsigned type the same as TYPE in other respects.  */
-tree
-c_common_unsigned_type (tree type)
-{
-  tree type1 = TYPE_MAIN_VARIANT (type);
-  if (type1 == signed_char_type_node || type1 == char_type_node)
-    return unsigned_char_type_node;
-  if (type1 == integer_type_node)
-    return unsigned_type_node;
-  if (type1 == short_integer_type_node)
-    return short_unsigned_type_node;
-  if (type1 == long_integer_type_node)
-    return long_unsigned_type_node;
-  if (type1 == long_long_integer_type_node)
-    return long_long_unsigned_type_node;
-  if (type1 == widest_integer_literal_type_node)
-    return widest_unsigned_literal_type_node;
-#if HOST_BITS_PER_WIDE_INT >= 64
-  if (type1 == intTI_type_node)
-    return unsigned_intTI_type_node;
-#endif
-  if (type1 == intDI_type_node)
-    return unsigned_intDI_type_node;
-  if (type1 == intSI_type_node)
-    return unsigned_intSI_type_node;
-  if (type1 == intHI_type_node)
-    return unsigned_intHI_type_node;
-  if (type1 == intQI_type_node)
-    return unsigned_intQI_type_node;
-
-  return c_common_signed_or_unsigned_type (1, type);
-}
-
 /* Return a signed type the same as TYPE in other respects.  */
 
 tree
@@ -2500,7 +2467,8 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
              default:
                break;
              }
-         type = c_common_unsigned_type (type);
+         /* unsigned_type_for doesn't support C bit fields */
+         type = c_common_signed_or_unsigned_type (1, type);
        }
 
       if (TREE_CODE (primop0) != INTEGER_CST)
@@ -3667,7 +3635,7 @@ c_common_nodes_and_builtins (void)
   else
     {
       signed_wchar_type_node = c_common_signed_type (wchar_type_node);
-      unsigned_wchar_type_node = c_common_unsigned_type (wchar_type_node);
+      unsigned_wchar_type_node = unsigned_type_for (wchar_type_node);
     }
 
   /* This is for wide string constants.  */
@@ -3685,7 +3653,7 @@ c_common_nodes_and_builtins (void)
   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 = c_common_unsigned_type (ptrdiff_type_node);
+  unsigned_ptrdiff_type_node = unsigned_type_for (ptrdiff_type_node);
 
   lang_hooks.decls.pushdecl
     (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"),
index 7e1967a..71a958d 100644 (file)
@@ -667,7 +667,6 @@ extern int c_common_handle_option (size_t code, const char *arg, int value);
 extern bool c_common_missing_argument (const char *opt, size_t code);
 extern tree c_common_type_for_mode (enum machine_mode, int);
 extern tree c_common_type_for_size (unsigned int, int);
-extern tree c_common_unsigned_type (tree);
 extern tree c_common_signed_type (tree);
 extern tree c_common_signed_or_unsigned_type (int, tree);
 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
index 9feb25c..db8412c 100644 (file)
@@ -4086,7 +4086,7 @@ grokdeclarator (const struct c_declarator *declarator,
      "signed".  */
   if (bitfield && !flag_signed_bitfields && !declspecs->explicit_signed_p
       && TREE_CODE (type) == INTEGER_TYPE)
-    type = c_common_unsigned_type (type);
+    type = unsigned_type_for (type);
 
   /* Figure out the type qualifiers for the declaration.  There are
      two ways a declaration can become qualified.  One is something
index a64e309..92e4ee6 100644 (file)
@@ -2249,7 +2249,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
          && TREE_CODE (cur_type) == INTEGER_TYPE
          && (!pedantic || i == 0 || (i == 1 && char_type_flag))
          && (TYPE_UNSIGNED (wanted_type)
-             ? wanted_type == c_common_unsigned_type (cur_type)
+             ? wanted_type == unsigned_type_for (cur_type)
              : wanted_type == c_common_signed_type (cur_type)))
        continue;
       /* Likewise, "signed char", "unsigned char" and "char" are
index 78438ad..9b923b5 100644 (file)
@@ -104,8 +104,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
 #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
 #undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
index 2b1e965..fc42389 100644 (file)
@@ -4095,8 +4095,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
       if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
          || (target_cmp = comp_target_types (type, rhstype))
          || is_opaque_pointer
-         || (c_common_unsigned_type (mvl)
-             == c_common_unsigned_type (mvr)))
+         || (unsigned_type_for (mvl)
+             == unsigned_type_for (mvr)))
        {
          if (pedantic
              && ((VOID_TYPE_P (ttl) && TREE_CODE (ttr) == FUNCTION_TYPE)
index 82b40ba..1cfb05c 100644 (file)
@@ -656,7 +656,7 @@ convert_to_integer (tree type, tree expr)
                             || !TYPE_OVERFLOW_WRAPS (TREE_TYPE (arg1)))
                            && (ex_form == PLUS_EXPR
                                || ex_form == MINUS_EXPR)))
-                     typex = lang_hooks.types.unsigned_type (typex);
+                     typex = unsigned_type_for (typex);
                    else
                      typex = lang_hooks.types.signed_type (typex);
                    return convert (type,
@@ -678,7 +678,7 @@ convert_to_integer (tree type, tree expr)
            /* Don't do unsigned arithmetic where signed was wanted,
               or vice versa.  */
            if (TYPE_UNSIGNED (TREE_TYPE (expr)))
-             typex = lang_hooks.types.unsigned_type (type);
+             typex = unsigned_type_for (type);
            else
              typex = lang_hooks.types.signed_type (type);
            return convert (type,
index a4c5cea..286a19b 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+       * decl.c (grokdeclarator): Use unsigned_type_for instead of
+       c_common_unsigned_type.
+
 2007-05-11  Silvius Rus  <rus@google.com>
 
        * cp/typeck.c (build_indirect_ref): Add call to
index 2c0dd83..6f17276 100644 (file)
@@ -136,8 +136,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
 #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
 #undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
index 31bc8d2..9b62658 100644 (file)
@@ -7376,7 +7376,7 @@ grokdeclarator (const cp_declarator *declarator,
       else if (type == char_type_node)
        type = unsigned_char_type_node;
       else if (typedef_decl)
-       type = c_common_unsigned_type (type);
+       type = unsigned_type_for (type);
       else
        type = unsigned_type_node;
     }
index 8e8a639..c1fdc31 100644 (file)
@@ -5044,7 +5044,7 @@ make_tree (tree type, rtx x)
                          make_tree (type, XEXP (x, 1)));
 
     case LSHIFTRT:
-      t = lang_hooks.types.unsigned_type (type);
+      t = unsigned_type_for (type);
       return fold_convert (type, build2 (RSHIFT_EXPR, t,
                                         make_tree (t, XEXP (x, 0)),
                                         make_tree (type, XEXP (x, 1))));
@@ -5065,7 +5065,7 @@ make_tree (tree type, rtx x)
                                         make_tree (t, XEXP (x, 0)),
                                         make_tree (t, XEXP (x, 1))));
     case UDIV:
-      t = lang_hooks.types.unsigned_type (type);
+      t = unsigned_type_for (type);
       return fold_convert (type, build2 (TRUNC_DIV_EXPR, t,
                                         make_tree (t, XEXP (x, 0)),
                                         make_tree (t, XEXP (x, 1))));
index ba17d46..c4c6edc 100644 (file)
@@ -1411,7 +1411,7 @@ fold_negate_expr (tree t)
            {
              tree ntype = TYPE_UNSIGNED (type)
                           ? lang_hooks.types.signed_type (type)
-                          : lang_hooks.types.unsigned_type (type);
+                          : unsigned_type_for (type);
              tree temp = fold_convert (ntype, TREE_OPERAND (t, 0));
              temp = fold_build2 (RSHIFT_EXPR, ntype, temp, op1);
              return fold_convert (type, temp);
@@ -4352,7 +4352,7 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
     {
       if (! TYPE_UNSIGNED (etype))
        {
-         etype = lang_hooks.types.unsigned_type (etype);
+         etype = unsigned_type_for (etype);
          high = fold_convert (etype, high);
          exp = fold_convert (etype, exp);
        }
@@ -4420,7 +4420,7 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
 
       /* Check if (unsigned) INT_MAX + 1 == (unsigned) INT_MIN
         for the type in question, as we rely on this here.  */
-      utype = lang_hooks.types.unsigned_type (etype);
+      utype = unsigned_type_for (etype);
       maxv = fold_convert (utype, TYPE_MAX_VALUE (etype));
       maxv = range_binop (PLUS_EXPR, NULL_TREE, maxv, 1,
                          integer_one_node, 1);
@@ -7798,7 +7798,7 @@ fold_unary (enum tree_code code, tree type, tree op0)
                  && (LOAD_EXTEND_OP (TYPE_MODE (TREE_TYPE (and0)))
                      == ZERO_EXTEND))
                {
-                 tree uns = lang_hooks.types.unsigned_type (TREE_TYPE (and0));
+                 tree uns = unsigned_type_for (TREE_TYPE (and0));
                  and0 = fold_convert (uns, and0);
                  and1 = fold_convert (uns, and1);
                }
@@ -11220,7 +11220,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
              || TREE_CODE (arg0) == ROUND_MOD_EXPR)
          && integer_pow2p (TREE_OPERAND (arg0, 1)))
        {
-         tree newtype = lang_hooks.types.unsigned_type (TREE_TYPE (arg0));
+         tree newtype = unsigned_type_for (TREE_TYPE (arg0));
          tree newmod = fold_build2 (TREE_CODE (arg0), newtype,
                                     fold_convert (newtype,
                                                   TREE_OPERAND (arg0, 0)),
@@ -12329,7 +12329,7 @@ fold_ternary (enum tree_code code, tree type, tree op0, tree op1, tree op2)
              else if ((TREE_INT_CST_HIGH (arg1) & mask_hi) == 0
                       && (TREE_INT_CST_LOW (arg1) & mask_lo) == 0)
                {
-                 tem_type = lang_hooks.types.unsigned_type (TREE_TYPE (tem));
+                 tem_type = unsigned_type_for (TREE_TYPE (tem));
                  tem = fold_convert (tem_type, tem);
                }
              else
index 4046c88..f94b3c3 100644 (file)
@@ -1,3 +1,13 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * f95-lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+       * trans-intrinsic.c (gfc_conv_intrinsic_ishft): Use unsigned_type_for
+       instead of gfc_unsigned_type.
+       * trans-stmt.c (gfc_trans_do): Use unsigned_type_for instead of
+       gfc_unsigned_type.
+       * trans-types.c (gfc_unsigned_type): Remove.
+       * trans-types.h (gfc_unsigned_type): Remove.
+
 2007-05-12  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/30746
index 4995e4c..d4fc2cc 100644 (file)
@@ -113,7 +113,6 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
 #undef LANG_HOOKS_MARK_ADDRESSABLE
 #undef LANG_HOOKS_TYPE_FOR_MODE
 #undef LANG_HOOKS_TYPE_FOR_SIZE
-#undef LANG_HOOKS_UNSIGNED_TYPE
 #undef LANG_HOOKS_SIGNED_TYPE
 #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
 #undef LANG_HOOKS_CLEAR_BINDING_STACK
@@ -138,7 +137,6 @@ static HOST_WIDE_INT gfc_get_alias_set (tree);
 #define LANG_HOOKS_MARK_ADDRESSABLE        gfc_mark_addressable
 #define LANG_HOOKS_TYPE_FOR_MODE           gfc_type_for_mode
 #define LANG_HOOKS_TYPE_FOR_SIZE           gfc_type_for_size
-#define LANG_HOOKS_UNSIGNED_TYPE           gfc_unsigned_type
 #define LANG_HOOKS_SIGNED_TYPE             gfc_signed_type
 #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gfc_expand_function
 #define LANG_HOOKS_CLEAR_BINDING_STACK     gfc_clear_binding_stack
index 25c8e1e..33b2e22 100644 (file)
@@ -2400,7 +2400,7 @@ gfc_conv_intrinsic_ishft (gfc_se * se, gfc_expr * expr)
   arg2 = TREE_VALUE (TREE_CHAIN (arg));
   arg = TREE_VALUE (arg);
   type = TREE_TYPE (arg);
-  utype = gfc_unsigned_type (type);
+  utype = unsigned_type_for (type);
 
   width = fold_build1 (ABS_EXPR, TREE_TYPE (arg2), arg2);
 
index 92462cb..0fcc66f 100644 (file)
@@ -890,7 +890,7 @@ gfc_trans_do (gfc_code * code)
     {
       tree ustep;
 
-      utype = gfc_unsigned_type (type);
+      utype = unsigned_type_for (type);
 
       /* tmp = abs(to - from) / abs(step) */
       ustep = fold_convert (utype, fold_build1 (ABS_EXPR, type, step));
@@ -905,7 +905,7 @@ gfc_trans_do (gfc_code * code)
       /* TODO: We could use the same width as the real type.
         This would probably cause more problems that it solves
         when we implement "long double" types.  */
-      utype = gfc_unsigned_type (gfc_array_index_type);
+      utype = unsigned_type_for (gfc_array_index_type);
       tmp = fold_build2 (MINUS_EXPR, type, to, from);
       tmp = fold_build2 (RDIV_EXPR, type, tmp, step);
       tmp = fold_build1 (FIX_TRUNC_EXPR, utype, tmp);
index c31b732..d83987e 100644 (file)
@@ -1839,14 +1839,6 @@ gfc_type_for_mode (enum machine_mode mode, int unsignedp)
   return NULL_TREE;
 }
 
-/* Return an unsigned type the same as TYPE in other respects.  */
-
-tree
-gfc_unsigned_type (tree type)
-{
-  return get_signed_or_unsigned_type (1, type);
-}
-
 /* Return a signed type the same as TYPE in other respects.  */
 
 tree
index c39c375..761b218 100644 (file)
@@ -82,7 +82,6 @@ tree gfc_get_function_type (gfc_symbol *);
 
 tree gfc_type_for_size (unsigned, int);
 tree gfc_type_for_mode (enum machine_mode, int);
-tree gfc_unsigned_type (tree);
 tree gfc_signed_type (tree);
 
 tree gfc_get_element_type (tree);
index 202ffc3..dceb969 100644 (file)
@@ -1,3 +1,11 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * expr.c (build_java_binop): Use unsigned_type_for instead of
+       java_unsigned_type.
+       * java-tree.h (java_unsigned_type): Remove.
+       * lang.c (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+       * typeck.c (java_unsigned_type): Remove.
+
 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * java-tree.h (lang_tree_node): Use GENERIC_NEXT
index 1a5ec68..c915a91 100644 (file)
@@ -1523,7 +1523,7 @@ build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
     {
     case URSHIFT_EXPR:
       {
-       tree u_type = java_unsigned_type (type);
+       tree u_type = unsigned_type_for (type);
        arg1 = convert (u_type, arg1);
        arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2);
        return convert (type, arg1);
index d560dee..cf41ef2 100644 (file)
@@ -1099,7 +1099,6 @@ extern void java_parse_file (int);
 extern bool java_mark_addressable (tree);
 extern tree java_type_for_mode (enum machine_mode, int);
 extern tree java_type_for_size (unsigned int, int);
-extern tree java_unsigned_type (tree);
 extern tree java_signed_type (tree);
 extern tree java_truthvalue_conversion (tree);
 extern void add_assume_compiled (const char *, int);
index 723d9a6..5b0cbe8 100644 (file)
@@ -184,8 +184,6 @@ struct language_function GTY(())
 #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_TREE_DUMP_DUMP_TREE_FN
 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN java_dump_tree
index b35461b..0d70929 100644 (file)
@@ -203,14 +203,6 @@ java_signed_type (tree type)
   return get_signed_or_unsigned_type (0, type);
 }
 
-/* Return an unsigned type the same as TYPE in other respects.  */
-
-tree
-java_unsigned_type (tree type)
-{
-  return get_signed_or_unsigned_type (1, type);
-}
-
 /* Mark EXP saying that we need to be able to take the
    address of it; it should not be allocated in a register.
    Value is true if successful.  */
index c2d5bc2..def7a4a 100644 (file)
@@ -211,7 +211,6 @@ extern tree lhd_make_node (enum tree_code);
   LANG_HOOKS_MAKE_TYPE, \
   LANG_HOOKS_TYPE_FOR_MODE, \
   LANG_HOOKS_TYPE_FOR_SIZE, \
-  LANG_HOOKS_UNSIGNED_TYPE, \
   LANG_HOOKS_SIGNED_TYPE, \
   LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
   LANG_HOOKS_GENERIC_TYPE_P, \
index 3e38f26..b3719c7 100644 (file)
@@ -103,10 +103,6 @@ struct lang_hooks_for_types
      integer type with at least that precision.  */
   tree (*type_for_size) (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) (tree);
-
   /* Given an integer type T, return a type like T but signed.
      If T is signed, the value is T.  */
   tree (*signed_type) (tree);
index b636de6..2d96bd7 100644 (file)
@@ -7731,14 +7731,22 @@ int_cst_value (tree x)
 }
 
 
+/* Return an unsigned type the same as TYPE in other respects.  */
+
+static tree
+get_unsigned_type (tree type)
+{
+  return get_signed_or_unsigned_type (1, type);
+}
+
 /* Returns unsigned variant of TYPE.  */
 
 tree
 unsigned_type_for (tree type)
 {
   if (POINTER_TYPE_P (type))
-    return lang_hooks.types.unsigned_type (size_type_node);
-  return lang_hooks.types.unsigned_type (type);
+    return get_unsigned_type (size_type_node);
+  return get_unsigned_type (type);
 }
 
 /* Returns signed variant of TYPE.  */
index 2903de6..b74851c 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * treetree.c (tree_lang_unsigned_type): Remove.
+       (LANG_HOOKS_UNSIGNED_TYPE): Remove.
+
 2007-03-30  Rafael Avila de Espindola  <espindola@google.com>
 
        * treetree.c (tree_lang_signed_or_unsigned_type): Remove.
index 0645b9d..d288c0e 100644 (file)
@@ -127,7 +127,6 @@ struct language_function GTY(())
 static bool tree_mark_addressable (tree exp);
 static tree tree_lang_type_for_size (unsigned precision, int unsignedp);
 static tree tree_lang_type_for_mode (enum machine_mode mode, int unsignedp);
-static tree tree_lang_unsigned_type (tree type_node);
 static tree tree_lang_signed_type (tree type_node);
 
 /* Functions to keep track of the current scope.  */
@@ -153,8 +152,6 @@ static void treelang_expand_function (tree fndecl);
 #define LANG_HOOKS_MARK_ADDRESSABLE tree_mark_addressable
 #undef LANG_HOOKS_SIGNED_TYPE
 #define LANG_HOOKS_SIGNED_TYPE tree_lang_signed_type
-#undef LANG_HOOKS_UNSIGNED_TYPE
-#define LANG_HOOKS_UNSIGNED_TYPE tree_lang_unsigned_type
 #undef LANG_HOOKS_TYPE_FOR_MODE
 #define LANG_HOOKS_TYPE_FOR_MODE tree_lang_type_for_mode
 #undef LANG_HOOKS_TYPE_FOR_SIZE
@@ -865,14 +862,6 @@ tree_lang_type_for_mode (enum machine_mode mode, int unsignedp)
     return NULL_TREE;
 }
 
-/* Return the unsigned version of a TYPE_NODE, a scalar type.  */
-
-static tree
-tree_lang_unsigned_type (tree type_node)
-{
-  return tree_lang_type_for_size (TYPE_PRECISION (type_node), 1);
-}
-
 /* Return the signed version of a TYPE_NODE, a scalar type.  */
 
 static tree