]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in (convert.o, [...]): Update.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Fri, 29 Mar 2002 21:46:27 +0000 (21:46 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 29 Mar 2002 21:46:27 +0000 (21:46 +0000)
* Makefile.in (convert.o, calls.o, expmed.o): Update.
* attribs.c (handle_mode_attribute, handle_vector_size_attribute):
Use new hooks.
* builtin-types.def (BT_PTRMODE): Update.
* c-common.c (type_for_size): Rename c_common_type_for_size.
(type_for_mode): Similarly.
(shorten_compare, pointer_int_sum, c_common_nodes_and_builtins):
Use new hook.
* c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New.
* c-decl.c (finish_enum, build_enumerator): Use new hooks.
* c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
Redefine.
* c-typeck.c (common_type, comptypes, default_conversion):
Use new hooks.
* calls.c: Include langhooks.h.
(emit_library_call_value_1): Use new hooks.  Avoid redundant
calls.
* convert.c: Include langhooks.h
(convert_to_pointer, convert_to_integer): Use new hooks.
* except.c (init_eh): Similarly.
* expmed.c: Include langhooks.h.
(expand_mult_add): Use new hooks.
* expr.c (store_expr, store_constructor, expand_expr, do_jump,
try_casesi): Similarly.
* fold-const.c (optimize_bit_field_compare, make_range,
decode_field_reference, fold_truthop, fold): Similarly.
* function.c (assign_stack_local_1, assign_stack_temp_for_type,
put_var_into_stack): Similarly.
* langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE,
LANG_HOOKS_TYPE_FOR_SIZE): New.
(LANG_HOOKS_TYPES_INITIALIZER): Update.
* langhooks.h (lang_hooks_for_types): New hooks.
* stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks.
* tree.c (get_unwidened, get_narrower): Similarly.
* tree.h (type_for_mode, type_for_size): Remove.
* varasm.c (force_const_mem): Use new hooks.
ada:
* gigi.h (type_for_size, type_for_mode): Rename.
* misc.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
Redefine.
* trans.c (tree_transform): Update.
* utils.c (gnat_init_decl_processing, init_gigi_decls,
builtin_function, float_type_for_size, signed_or_unsigned_type,
build_vms_descriptor, unchecked_convert): Update.
(type_for_mode, type_for_size): Rename.
* utils2.c (nonbinary_modular_operation): Update.
cp:
* cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
Redefine.
* cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks.
* decl.c (finish_enum): Similarly.
* error.c (dump_type): Similarly.
* lex.c (cxx_init): Similarly.
* mangle.c (write_builtin_type): Similarly.
* typeck.c (comptypes): Similarly.
f:
* com.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
Redefine.
(type_for_mode, type_for_size): Rename.
(signed_or_unsigned_type, signed_type, truthvalue_conversion,
unsigned_type): Use new hooks.
java:
* Make-lang.in (builtins.o): Update.
* boehm.c (get_boehm_type_descriptor): Update.
* builtins.c: Include langhooks.h.
* decl.c (java_init_decl_processing): Update.
* java-tree.h (java_type_for_mode, java_type_for_size): New.
* lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
Redefine.
* typeck.c (type_for_mode, type_for_size): Update.
objc:
* objc-act.c (handle_impent): Update.
* objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
Redefine.

From-SVN: r51571

47 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/ada/gigi.h
gcc/ada/misc.c
gcc/ada/trans.c
gcc/ada/utils.c
gcc/ada/utils2.c
gcc/attribs.c
gcc/builtin-types.def
gcc/c-common.c
gcc/c-common.h
gcc/c-decl.c
gcc/c-lang.c
gcc/c-typeck.c
gcc/calls.c
gcc/convert.c
gcc/cp/ChangeLog
gcc/cp/cp-lang.c
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/lex.c
gcc/cp/mangle.c
gcc/cp/typeck.c
gcc/except.c
gcc/expmed.c
gcc/expr.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/fold-const.c
gcc/function.c
gcc/java/ChangeLog
gcc/java/Make-lang.in
gcc/java/boehm.c
gcc/java/builtins.c
gcc/java/decl.c
gcc/java/java-tree.h
gcc/java/lang.c
gcc/java/typeck.c
gcc/langhooks-def.h
gcc/langhooks.h
gcc/objc/objc-act.c
gcc/objc/objc-lang.c
gcc/stmt.c
gcc/tree.c
gcc/tree.h
gcc/varasm.c

index 17695ffa5db583d6b21ece72cccded744565e5c4..1b85c02f6c84246efa7b1b0c310a0862c21c835a 100644 (file)
@@ -1,3 +1,47 @@
+2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * Makefile.in (convert.o, calls.o, expmed.o): Update.
+       * attribs.c (handle_mode_attribute, handle_vector_size_attribute):
+       Use new hooks.
+       * builtin-types.def (BT_PTRMODE): Update.
+       * c-common.c (type_for_size): Rename c_common_type_for_size.
+       (type_for_mode): Similarly.
+       (shorten_compare, pointer_int_sum, c_common_nodes_and_builtins):
+       Use new hook.
+       * c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New.
+       * c-decl.c (finish_enum, build_enumerator): Use new hooks.
+       * c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
+       Redefine.
+       * c-typeck.c (common_type, comptypes, default_conversion):
+       Use new hooks.
+       * calls.c: Include langhooks.h.
+       (emit_library_call_value_1): Use new hooks.  Avoid redundant
+       calls.
+       * convert.c: Include langhooks.h
+       (convert_to_pointer, convert_to_integer): Use new hooks.
+       * except.c (init_eh): Similarly.
+       * expmed.c: Include langhooks.h.
+       (expand_mult_add): Use new hooks.
+       * expr.c (store_expr, store_constructor, expand_expr, do_jump,
+       try_casesi): Similarly.
+       * fold-const.c (optimize_bit_field_compare, make_range,
+       decode_field_reference, fold_truthop, fold): Similarly.
+       * function.c (assign_stack_local_1, assign_stack_temp_for_type,
+       put_var_into_stack): Similarly.
+       * langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE,
+       LANG_HOOKS_TYPE_FOR_SIZE): New.
+       (LANG_HOOKS_TYPES_INITIALIZER): Update.
+       * langhooks.h (lang_hooks_for_types): New hooks.
+       * stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks.
+       * tree.c (get_unwidened, get_narrower): Similarly.
+       * tree.h (type_for_mode, type_for_size): Remove.
+       * varasm.c (force_const_mem): Use new hooks.
+       * utils2.c (nonbinary_modular_operation): Update.
+objc:
+       * objc-act.c (handle_impent): Update.
+       * objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
+       Redefine.
+
 2002-03-29  Steve Ellcey  <sje@cup.hp.com>
 
        * config/ia64/ia64.md (*ptr_extend_plus_1, *ptr_extend_plus_2): New.
index 7162b3264c2edea8e97a536f1b7a6b521ebb3d59..23fba7f2071c5a131acd294a2be0fa671670d4b8 100644 (file)
@@ -1319,7 +1319,8 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
        -DPREFIX=\"$(prefix)\" \
          -c $(srcdir)/prefix.c $(OUTPUT_OPTION)
 
-convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h toplev.h
+convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h \
+   toplev.h langhooks.h
 
 langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \
    tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
@@ -1395,11 +1396,12 @@ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
    $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
    $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
    except.h $(TM_P_H) $(PREDICT_H) libfuncs.h
-calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
+calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
+   $(EXPR_H) langhooks.h \
    libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
 expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h  \
    insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
-   toplev.h $(TM_P_H)
+   toplev.h $(TM_P_H) langhooks.h
 explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
    hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
    toplev.h function.h ggc.h $(TM_P_H)
index b8da148cc625a0a5580795c8a8ff7763a950d8fd..0223eac3c591348e864cc893afb0238971759f04 100644 (file)
@@ -423,11 +423,11 @@ extern void gnat_init_gcc_eh              PARAMS ((void));
 /* Return an integer type with the number of bits of precision given by  
    PRECISION.  UNSIGNEDP is nonzero if the type is unsigned; otherwise
    it is a signed type.  */
-extern tree type_for_size              PARAMS ((unsigned, int));
+extern tree gnat_type_for_size         PARAMS ((unsigned, int));
 
 /* Return a data type that has machine mode MODE.  UNSIGNEDP selects
    an unsigned type; otherwise a signed type is returned.  */
-extern tree type_for_mode              PARAMS ((enum machine_mode, int));
+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));
index 982e7c005800f79550c9ab5a302de98b7fa7ca7b..78222c2f8d74017df6c747c2d6100b5f94624207 100644 (file)
@@ -118,6 +118,10 @@ static rtx gnat_expand_expr                PARAMS ((tree, rtx, enum machine_mode,
 #define LANG_HOOKS_PRINT_TYPE          gnat_print_type
 #undef LANG_HOOKS_DECL_PRINTABLE_NAME
 #define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name
+#undef LANG_HOOKS_TYPE_FOR_MODE
+#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
 
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
index 9875bb1d0a950e84e7209089de8b8081600ce793..c943a0092257f185186ed118b7e22516fb5413df 100644 (file)
@@ -2994,7 +2994,7 @@ tree_transform (gnat_node)
                  gnu_actual
                    = unchecked_convert
                      (DECL_ARG_TYPE (get_gnu_tree (gnat_formal)),
-                      convert (type_for_size
+                      convert (gnat_type_for_size
                                (tree_low_cst (gnu_actual_size, 1), 1),
                                integer_zero_node));
                else
index 776fbbeb2f0220200996119318827b57e2d99b53..d01e7d84a4d22055fc205e117a2750d0a66749fa 100644 (file)
@@ -499,7 +499,7 @@ gnat_init_decl_processing ()
   /* In Ada, we use a signed type for SIZETYPE.  Use the signed type
      corresponding to the size of ptr_mode.  Make this here since we need
      this before we can expand the GNAT types.  */
-  set_sizetype (type_for_size (GET_MODE_BITSIZE (ptr_mode), 0));
+  set_sizetype (gnat_type_for_size (GET_MODE_BITSIZE (ptr_mode), 0));
   build_common_tree_nodes_2 (0);
 
   pushdecl (build_decl (TYPE_DECL, get_identifier (SIZE_TYPE), sizetype));
@@ -543,7 +543,7 @@ init_gigi_decls (long_long_float_type, exception_type)
 
   except_type_node = TREE_TYPE (exception_type);
 
-  unsigned_type_node = type_for_size (INT_TYPE_SIZE, 1);
+  unsigned_type_node = gnat_type_for_size (INT_TYPE_SIZE, 1);
   pushdecl (build_decl (TYPE_DECL, get_identifier ("unsigned int"),
                        unsigned_type_node));
 
@@ -579,7 +579,7 @@ init_gigi_decls (long_long_float_type, exception_type)
 
   /* Make the types and functions used for exception processing.    */
   jmpbuf_type
-    = build_array_type (type_for_mode (Pmode, 0),
+    = build_array_type (gnat_type_for_mode (Pmode, 0),
                        build_index_type (build_int_2 (5, 0)));
   pushdecl (build_decl (TYPE_DECL, get_identifier ("JMPBUF_T"), jmpbuf_type));
   jmpbuf_ptr_type = build_pointer_type (jmpbuf_type);
@@ -1954,7 +1954,7 @@ builtin_function (name, type, function_code, class, library_name)
    it is a signed type.  */
 
 tree
-type_for_size (precision, unsignedp)
+gnat_type_for_size (precision, unsignedp)
      unsigned precision;
      int unsignedp;
 {
@@ -2015,14 +2015,14 @@ float_type_for_size (precision, mode)
    an unsigned type; otherwise a signed type is returned.  */
 
 tree
-type_for_mode (mode, unsignedp)
+gnat_type_for_mode (mode, unsignedp)
      enum machine_mode mode;
      int unsignedp;
 {
   if (GET_MODE_CLASS (mode) == MODE_FLOAT)
     return float_type_for_size (GET_MODE_BITSIZE (mode), mode);
   else
-    return type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
+    return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
 }
 
 /* Return the unsigned version of a TYPE_NODE, a scalar type.  */
@@ -2031,7 +2031,7 @@ tree
 unsigned_type (type_node)
      tree type_node;
 {
-  tree type = type_for_size (TYPE_PRECISION (type_node), 1);
+  tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1);
 
   if (TREE_CODE (type_node) == INTEGER_TYPE && TYPE_MODULAR_P (type_node))
     {
@@ -2055,7 +2055,7 @@ tree
 signed_type (type_node)
      tree type_node;
 {
-  tree type = type_for_size (TYPE_PRECISION (type_node), 0);
+  tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 0);
 
   if (TREE_CODE (type_node) == INTEGER_TYPE && TYPE_MODULAR_P (type_node))
     {
@@ -2084,7 +2084,7 @@ signed_or_unsigned_type (unsignedp, type)
   if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
     return type;
   else
-    return type_for_size (TYPE_PRECISION (type), unsignedp);
+    return gnat_type_for_size (TYPE_PRECISION (type), unsignedp);
 }
 \f
 /* EXP is an expression for the size of an object.  If this size contains
@@ -2401,14 +2401,16 @@ build_vms_descriptor (type, mech, gnat_entity)
   field_list
     = chainon (field_list,
               make_descriptor_field
-              ("LENGTH", type_for_size (16, 1), record_type,
+              ("LENGTH", gnat_type_for_size (16, 1), record_type,
                size_in_bytes (mech == By_Descriptor_A ? inner_type : type)));
 
   field_list = chainon (field_list,
-                       make_descriptor_field ("DTYPE", type_for_size (8, 1),
+                       make_descriptor_field ("DTYPE",
+                                              gnat_type_for_size (8, 1),
                                               record_type, size_int (dtype)));
   field_list = chainon (field_list,
-                       make_descriptor_field ("CLASS", type_for_size (8, 1),
+                       make_descriptor_field ("CLASS",
+                                              gnat_type_for_size (8, 1),
                                               record_type, size_int (class)));
 
   field_list
@@ -2431,13 +2433,13 @@ build_vms_descriptor (type, mech, gnat_entity)
       field_list
        = chainon (field_list,
                   make_descriptor_field 
-                  ("SB_L1", type_for_size (32, 1), record_type,
+                  ("SB_L1", gnat_type_for_size (32, 1), record_type,
                    TREE_CODE (type) == ARRAY_TYPE
                    ? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
       field_list
        = chainon (field_list,
                   make_descriptor_field
-                  ("SB_L2", type_for_size (32, 1), record_type,
+                  ("SB_L2", gnat_type_for_size (32, 1), record_type,
                    TREE_CODE (type) == ARRAY_TYPE
                    ? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
       break;
@@ -2446,20 +2448,20 @@ build_vms_descriptor (type, mech, gnat_entity)
     case By_Descriptor_NCA:
       field_list = chainon (field_list,
                            make_descriptor_field ("SCALE",
-                                                  type_for_size (8, 1),
+                                                  gnat_type_for_size (8, 1),
                                                   record_type,
                                                   size_zero_node));
 
       field_list = chainon (field_list,
                            make_descriptor_field ("DIGITS",
-                                                  type_for_size (8, 1),
+                                                  gnat_type_for_size (8, 1),
                                                   record_type,
                                                   size_zero_node));
 
       field_list
        = chainon (field_list,
                   make_descriptor_field
-                  ("AFLAGS", type_for_size (8, 1), record_type,
+                  ("AFLAGS", gnat_type_for_size (8, 1), record_type,
                    size_int (mech == By_Descriptor_NCA
                              ? 0
                              /* Set FL_COLUMN, FL_COEFF, and FL_BOUNDS.  */
@@ -2469,13 +2471,13 @@ build_vms_descriptor (type, mech, gnat_entity)
 
       field_list = chainon (field_list,
                            make_descriptor_field ("DIMCT",
-                                                  type_for_size (8, 1),
+                                                  gnat_type_for_size (8, 1),
                                                   record_type,
                                                   size_int (ndim)));
 
       field_list = chainon (field_list,
                            make_descriptor_field ("ARSIZE",
-                                                  type_for_size (32, 1),
+                                                  gnat_type_for_size (32, 1),
                                                   record_type,
                                                   size_in_bytes (type)));
 
@@ -2507,11 +2509,11 @@ build_vms_descriptor (type, mech, gnat_entity)
 
          fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
          fname[1] = '0' + i, fname[2] = 0;
-         field_list = chainon (field_list,
-                               make_descriptor_field (fname,
-                                                      type_for_size (32, 1),
-                                                      record_type,
-                                                      idx_length));
+         field_list
+           = chainon (field_list,
+                      make_descriptor_field (fname,
+                                             gnat_type_for_size (32, 1),
+                                             record_type, idx_length));
 
          if (mech == By_Descriptor_NCA)
            tem = idx_length;
@@ -2526,14 +2528,14 @@ build_vms_descriptor (type, mech, gnat_entity)
          field_list
            = chainon (field_list,
                       make_descriptor_field
-                      (fname, type_for_size (32, 1), record_type,
+                      (fname, gnat_type_for_size (32, 1), record_type,
                        TYPE_MIN_VALUE (idx_arr[i])));
 
          fname[0] = 'U';
          field_list
            = chainon (field_list,
                       make_descriptor_field
-                      (fname, type_for_size (32, 1), record_type,
+                      (fname, gnat_type_for_size (32, 1), record_type,
                        TYPE_MAX_VALUE (idx_arr[i])));
        }
       break;
@@ -3348,7 +3350,8 @@ unchecked_convert (type, expr)
                                0))
       && ! (TREE_UNSIGNED (type) && TREE_UNSIGNED (etype)))
     {
-      tree base_type = type_for_mode (TYPE_MODE (type), TREE_UNSIGNED (type));
+      tree base_type = gnat_type_for_mode (TYPE_MODE (type),
+                                          TREE_UNSIGNED (type));
       tree shift_expr
        = convert (base_type,
                   size_binop (MINUS_EXPR,
index c10ddeaecce7789282685bc11bb1576147dee825..2872474bac82f590572c17301b7dd3a4168c92c3 100644 (file)
@@ -511,7 +511,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs)
       || TREE_UNSIGNED (op_type) != unsignedp)
     {
       /* Copy the node so we ensure it can be modified to make it modular.  */
-      op_type = copy_node (type_for_size (precision, unsignedp));
+      op_type = copy_node (gnat_type_for_size (precision, unsignedp));
       modulus = convert (op_type, modulus);
       TYPE_MODULUS (op_type) = modulus;
       TYPE_MODULAR_P (op_type) = 1;
@@ -527,7 +527,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs)
      possible size.  */
   if (op_code == MULT_EXPR)
     {
-      tree div_type = copy_node (type_for_size (needed_precision, 1));
+      tree div_type = copy_node (gnat_type_for_size (needed_precision, 1));
       modulus = convert (div_type, modulus);
       TYPE_MODULUS (div_type) = modulus;
       TYPE_MODULAR_P (div_type) = 1;
index 69d2ef26a640ab81e82d6f274c824053bf9463e1..74786a543768f5681476efd86d4b4c0fc57a4cdf 100644 (file)
@@ -835,8 +835,8 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
 
       if (mode == VOIDmode)
        error ("unknown machine mode `%s'", p);
-      else if (0 == (typefm = type_for_mode (mode,
-                                            TREE_UNSIGNED (type))))
+      else if (0 == (typefm = (*lang_hooks.types.type_for_mode)
+                    (mode, TREE_UNSIGNED (type))))
        error ("no data type for mode `%s'", p);
       else
        *node = typefm;
@@ -1343,7 +1343,8 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs)
     {
       tree index, array, rt;
 
-      new_type = type_for_mode (new_mode, TREE_UNSIGNED (type));
+      new_type = (*lang_hooks.types.type_for_mode) (new_mode,
+                                                   TREE_UNSIGNED (type));
 
       if (!new_type)
        {
index 24b87d30cfa3e22bdd70a9563ec1a4ecd028537b..7a33ffd78945b1592216a605082313c0efabdcf6 100644 (file)
@@ -73,7 +73,7 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONG_DOUBLE, complex_long_double_type_node)
 
 DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
 DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
-DEF_PRIMITIVE_TYPE (BT_PTRMODE, type_for_mode (ptr_mode, 0))
+DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
 DEF_PRIMITIVE_TYPE (BT_SIZE, c_size_type_node)
 DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
 DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node)
index f699c86ca390996cac435970aa5207c75a5c158b..cccd2bc8cebdc8093f006f06662e11e1cfb368fe 100644 (file)
@@ -1302,7 +1302,7 @@ check_case_value (value)
    that is unsigned if UNSIGNEDP is nonzero, otherwise signed.  */
 
 tree
-type_for_size (bits, unsignedp)
+c_common_type_for_size (bits, unsignedp)
      unsigned bits;
      int unsignedp;
 {
@@ -1346,7 +1346,7 @@ type_for_size (bits, unsignedp)
    then UNSIGNEDP selects between signed and unsigned types.  */
 
 tree
-type_for_mode (mode, unsignedp)
+c_common_type_for_mode (mode, unsignedp)
      enum machine_mode mode;
      int unsignedp;
 {
@@ -1761,7 +1761,7 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
         values from it's underlying integral type, not the enumerated
         type itself.  */
       if (TREE_CODE (type) == ENUMERAL_TYPE)
-       type = type_for_size (TYPE_PRECISION (type), unsignedp0);
+       type = c_common_type_for_size (TYPE_PRECISION (type), unsignedp0);
 
       maxval = TYPE_MAX_VALUE (type);
       minval = TYPE_MIN_VALUE (type);
@@ -2065,8 +2065,8 @@ pointer_int_sum (resultcode, ptrop, intop)
 
   if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
       || TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype))
-    intop = convert (type_for_size (TYPE_PRECISION (sizetype), 
-                                   TREE_UNSIGNED (sizetype)), intop);
+    intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype), 
+                                            TREE_UNSIGNED (sizetype)), intop);
 
   /* Replace the integer argument with a suitable product by the object size.
      Do this multiplication as signed, then convert to the appropriate
@@ -2577,7 +2577,8 @@ c_common_nodes_and_builtins ()
   record_builtin_type (RID_MAX, "signed char", signed_char_type_node);
   record_builtin_type (RID_MAX, "unsigned char", unsigned_char_type_node);
 
-  /* These are types that type_for_size and type_for_mode use.  */
+  /* These are types that c_common_type_for_size and
+     c_common_type_for_mode use.  */
   (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE,
                                            intQI_type_node));
   (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE,
index 7b11f70779ac671071e24f5ea8d25d3f87d5dbde..823b08137d2973c4ee09fd135d8fc00d324e28d7 100644 (file)
@@ -507,6 +507,9 @@ extern tree handle_format_attribute         PARAMS ((tree *, tree, tree,
 extern tree handle_format_arg_attribute                PARAMS ((tree *, tree, tree,
                                                         int, bool *));
 extern void c_common_insert_default_attributes PARAMS ((tree));
+extern tree c_common_type_for_mode             PARAMS ((enum machine_mode,
+                                                        int));
+extern tree c_common_type_for_size             PARAMS ((unsigned int, int));
 extern void c_apply_type_quals_to_decl         PARAMS ((int, tree));
 extern tree c_sizeof                           PARAMS ((tree));
 extern tree c_alignof                          PARAMS ((tree));
index 931f17487ac67622aa99549db0ec4cf112081e20..c7986218aa8a2abc330a33e82dee3ce47209bf3b 100644 (file)
@@ -5844,7 +5844,7 @@ finish_enum (enumtype, values, attributes)
                   min_precision (maxnode, unsign));
   if (TYPE_PACKED (enumtype) || precision > TYPE_PRECISION (integer_type_node))
     {
-      tree narrowest = type_for_size (precision, unsign);
+      tree narrowest = c_common_type_for_size (precision, unsign);
       if (narrowest == 0)
        {
          warning ("enumeration values exceed range of largest integer");
@@ -5857,7 +5857,7 @@ finish_enum (enumtype, values, attributes)
     precision = TYPE_PRECISION (integer_type_node);
 
   if (precision == TYPE_PRECISION (integer_type_node))
-    enum_value_type = type_for_size (precision, 0);
+    enum_value_type = c_common_type_for_size (precision, 0);
   else
     enum_value_type = enumtype;
 
@@ -5985,10 +5985,11 @@ build_enumerator (name, value)
   /* Now create a declaration for the enum value name.  */
 
   type = TREE_TYPE (value);
-  type = type_for_size (MAX (TYPE_PRECISION (type),
-                            TYPE_PRECISION (integer_type_node)),
-                       (TYPE_PRECISION (type) >= TYPE_PRECISION (integer_type_node)
-                        && TREE_UNSIGNED (type)));
+  type = c_common_type_for_size (MAX (TYPE_PRECISION (type),
+                                     TYPE_PRECISION (integer_type_node)),
+                                (TYPE_PRECISION (type)
+                                 >= TYPE_PRECISION (integer_type_node)
+                                 && TREE_UNSIGNED (type)));
 
   decl = build_decl (CONST_DECL, name, type);
   DECL_INITIAL (decl) = convert (type, value);
index c49c948fc465b95dcb5da7b931b5ba98dffa64bc..8e9516553a5dd9ac1ae11e04ed5a985ab9d5034b 100644 (file)
@@ -80,6 +80,11 @@ static void c_post_options PARAMS ((void));
 #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
   c_convert_parm_for_inlining
 
+#undef LANG_HOOKS_TYPE_FOR_MODE
+#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
+
 /* ### When changing hooks, consider if ObjC needs changing too!! ### */
 
 /* Each front end provides its own.  */
index 297b0f9e188d4952590fcf823b00219b7b4dc18f..a4ba65764325d522fa560ab12d23bc4fa669f48a 100644 (file)
@@ -216,9 +216,9 @@ common_type (t1, t2)
   /* Treat an enum type as the unsigned integer type of the same width.  */
 
   if (TREE_CODE (t1) == ENUMERAL_TYPE)
-    t1 = type_for_size (TYPE_PRECISION (t1), 1);
+    t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
   if (TREE_CODE (t2) == ENUMERAL_TYPE)
-    t2 = type_for_size (TYPE_PRECISION (t2), 1);
+    t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
 
   code1 = TREE_CODE (t1);
   code2 = TREE_CODE (t2);
@@ -465,9 +465,9 @@ comptypes (type1, type2)
      signedness.  */
 
   if (TREE_CODE (t1) == ENUMERAL_TYPE)
-    t1 = type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
+    t1 = c_common_type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
   if (TREE_CODE (t2) == ENUMERAL_TYPE)
-    t2 = type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
+    t2 = c_common_type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
 
   if (t1 == t2)
     return 1;
@@ -994,11 +994,11 @@ default_conversion (exp)
      but convert wide enums to something wider.  */
   if (code == ENUMERAL_TYPE)
     {
-      type = type_for_size (MAX (TYPE_PRECISION (type),
-                                TYPE_PRECISION (integer_type_node)),
-                           ((TYPE_PRECISION (type)
-                             >= TYPE_PRECISION (integer_type_node))
-                            && TREE_UNSIGNED (type)));
+      type = c_common_type_for_size (MAX (TYPE_PRECISION (type),
+                                         TYPE_PRECISION (integer_type_node)),
+                                    ((TYPE_PRECISION (type)
+                                      >= TYPE_PRECISION (integer_type_node))
+                                     && TREE_UNSIGNED (type)));
 
       return convert (type, exp);
     }
index 67715229b8d5db0454050fed370526405c6f84aa..cbeb92c20aa3964713d7ad4150f145f4b5f24d6b 100644 (file)
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "tm_p.h"
 #include "timevar.h"
 #include "sbitmap.h"
+#include "langhooks.h"
 
 #if !defined FUNCTION_OK_FOR_SIBCALL
 #define FUNCTION_OK_FOR_SIBCALL(DECL) 1
@@ -3476,6 +3477,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
   int reg_parm_stack_space = 0;
   int needed;
   rtx before_call;
+  tree tfom;                   /* type_for_mode (outmode, 0) */
 
 #ifdef REG_PARM_STACK_SPACE
   /* Define the boundary of the register parm stack space that needs to be
@@ -3537,27 +3539,31 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
 
   /* If this kind of value comes back in memory,
      decide where in memory it should come back.  */
-  if (outmode != VOIDmode && aggregate_value_p (type_for_mode (outmode, 0)))
+  if (outmode != VOIDmode)
     {
+      tfom = (*lang_hooks.types.type_for_mode) (outmode, 0);
+      if (aggregate_value_p (tfom))
+       {
 #ifdef PCC_STATIC_STRUCT_RETURN
-      rtx pointer_reg
-       = hard_function_value (build_pointer_type (type_for_mode (outmode, 0)),
-                              0, 0);
-      mem_value = gen_rtx_MEM (outmode, pointer_reg);
-      pcc_struct_value = 1;
-      if (value == 0)
-       value = gen_reg_rtx (outmode);
+         rtx pointer_reg
+           = hard_function_value (build_pointer_type (tfom), 0, 0);
+         mem_value = gen_rtx_MEM (outmode, pointer_reg);
+         pcc_struct_value = 1;
+         if (value == 0)
+           value = gen_reg_rtx (outmode);
 #else /* not PCC_STATIC_STRUCT_RETURN */
-      struct_value_size = GET_MODE_SIZE (outmode);
-      if (value != 0 && GET_CODE (value) == MEM)
-       mem_value = value;
-      else
-       mem_value = assign_temp (type_for_mode (outmode, 0), 0, 1, 1);
+         struct_value_size = GET_MODE_SIZE (outmode);
+         if (value != 0 && GET_CODE (value) == MEM)
+           mem_value = value;
+         else
+           mem_value = assign_temp (tfom, 0, 1, 1);
 #endif
-
-      /* This call returns a big structure.  */
-      flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
+         /* This call returns a big structure.  */
+         flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
+       }
     }
+  else
+    tfom = void_type_node;
 
   /* ??? Unfinished: must pass the memory address as an argument.  */
 
@@ -3670,12 +3676,13 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
            slot = val;
          else if (must_copy)
            {
-             slot = assign_temp (type_for_mode (mode, 0), 0, 1, 1);
+             slot = assign_temp ((*lang_hooks.types.type_for_mode) (mode, 0),
+                                 0, 1, 1);
              emit_move_insn (slot, val);
            }
          else
            {
-             tree type = type_for_mode (mode, 0);
+             tree type = (*lang_hooks.types.type_for_mode) (mode, 0);
 
              slot = gen_rtx_MEM (mode,
                                  expand_expr (build1 (ADDR_EXPR,
@@ -4042,8 +4049,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
 
   emit_call_1 (fun,
               get_identifier (XSTR (orgfun, 0)),
-              build_function_type (outmode == VOIDmode ? void_type_node
-                                   : type_for_mode (outmode, 0), NULL_TREE),
+              build_function_type (tfom, NULL_TREE),
               original_args_size.constant, args_size.constant,
               struct_value_size,
               FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1),
index 127b22b7eef5747356e67cc0ab9bb7c6fa1c3994..25aae573caccb6438f4c0fe4adfadbb3dabd1714 100644 (file)
@@ -29,6 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "flags.h"
 #include "convert.h"
 #include "toplev.h"
+#include "langhooks.h"
 
 /* Convert EXPR to some pointer or reference type TYPE.
 
@@ -61,7 +62,8 @@ convert_to_pointer (type, expr)
 
       return
        convert_to_pointer (type,
-                           convert (type_for_size (POINTER_SIZE, 0), expr));
+                           convert ((*lang_hooks.types.type_for_size)
+                                    (POINTER_SIZE, 0), expr));
 
     default:
       error ("cannot convert to a pointer type");
@@ -138,8 +140,8 @@ convert_to_integer (type, expr)
       if (integer_zerop (expr))
        expr = integer_zero_node;
       else
-       expr = fold (build1 (CONVERT_EXPR,
-                            type_for_size (POINTER_SIZE, 0), expr));
+       expr = fold (build1 (CONVERT_EXPR, (*lang_hooks.types.type_for_size)
+                            (POINTER_SIZE, 0), expr));
 
       return convert_to_integer (type, expr);
 
@@ -189,8 +191,8 @@ convert_to_integer (type, expr)
       else if (TREE_CODE (type) == ENUMERAL_TYPE
               || outprec != GET_MODE_BITSIZE (TYPE_MODE (type)))
        return build1 (NOP_EXPR, type,
-                      convert (type_for_mode (TYPE_MODE (type),
-                                              TREE_UNSIGNED (type)),
+                      convert ((*lang_hooks.types.type_for_mode)
+                               (TYPE_MODE (type), TREE_UNSIGNED (type)),
                                expr));
 
       /* Here detect when we can distribute the truncation down past some
@@ -300,8 +302,8 @@ convert_to_integer (type, expr)
                /* Can't do arithmetic in enumeral types
                   so use an integer type that will hold the values.  */
                if (TREE_CODE (typex) == ENUMERAL_TYPE)
-                 typex = type_for_size (TYPE_PRECISION (typex),
-                                        TREE_UNSIGNED (typex));
+                 typex = (*lang_hooks.types.type_for_size)
+                   (TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
 
                /* But now perhaps TYPEX is as wide as INPREC.
                   In that case, do nothing special here.
@@ -338,8 +340,8 @@ convert_to_integer (type, expr)
            /* Can't do arithmetic in enumeral types
               so use an integer type that will hold the values.  */
            if (TREE_CODE (typex) == ENUMERAL_TYPE)
-             typex = type_for_size (TYPE_PRECISION (typex),
-                                    TREE_UNSIGNED (typex));
+             typex = (*lang_hooks.types.type_for_size)
+               (TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
 
            /* But now perhaps TYPEX is as wide as INPREC.
               In that case, do nothing special here.
index b7f8cb2cc78e03a199ec4159c261482e8df407ae..8dd802c9b1dbd53e5e8d7b7951987bf9565ea8b8 100644 (file)
@@ -1,3 +1,14 @@
+2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
+       Redefine.
+       * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks.
+       * decl.c (finish_enum): Similarly.
+       * error.c (dump_type): Similarly.
+       * lex.c (cxx_init): Similarly.
+       * mangle.c (write_builtin_type): Similarly.
+       * typeck.c (comptypes): Similarly.
+
 2002-03-28  Roger Sayle  <roger@eyesopen.com>
 
        PR c++/5998:
index a3ede8da133974c06c08fd1e992591127a0e89d6..5cd481de4232980cfb02c981452cb6eab3b58be7 100644 (file)
@@ -111,6 +111,10 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
 
 #undef LANG_HOOKS_MAKE_TYPE
 #define LANG_HOOKS_MAKE_TYPE cxx_make_type
+#undef LANG_HOOKS_TYPE_FOR_MODE
+#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
 
 /* Each front end provides its own hooks, for toplev.c.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
index cea204e29dc0dc4249a54dea90c97d5208e1cd06..d934df03de50d59eb5d839a706878dd304529132 100644 (file)
@@ -256,7 +256,7 @@ cp_convert_to_pointer (type, expr, force)
     {
       if (TYPE_PRECISION (intype) == POINTER_SIZE)
        return build1 (CONVERT_EXPR, type, expr);
-      expr = cp_convert (type_for_size (POINTER_SIZE, 0), expr);
+      expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
       /* Modes may be different but sizes should be the same.  */
       if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
          != GET_MODE_SIZE (TYPE_MODE (type)))
@@ -1183,10 +1183,10 @@ type_promotes_to (type)
     {
       int precision = MAX (TYPE_PRECISION (type),
                           TYPE_PRECISION (integer_type_node));
-      tree totype = type_for_size (precision, 0);
+      tree totype = c_common_type_for_size (precision, 0);
       if (TREE_UNSIGNED (type)
          && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype))
-       type = type_for_size (precision, 1);
+       type = c_common_type_for_size (precision, 1);
       else
        type = totype;
     }
index 1739771debff68d6f1603b20d5d8f67a1c2e13cb..8ba011e601ad0f67600abde4b667a3ce7177d994 100644 (file)
@@ -13247,7 +13247,7 @@ finish_enum (enumtype)
   if (flag_short_enums || (precision > TYPE_PRECISION (integer_type_node)))
     /* Use the width of the narrowest normal C type which is wide
        enough.  */
-    TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size
+    TYPE_PRECISION (enumtype) = TYPE_PRECISION (c_common_type_for_size
                                                (precision, 1));
   else
     TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
index 812def9f3827bbaa0b8235dddd8aa6b6cb339aa9..b411d27da7f9cc02ecef7407e06b50748506712e 100644 (file)
@@ -387,7 +387,7 @@ dump_type (t, flags)
           which has no name and is not very useful for diagnostics.  So
           look up the equivalent C type and print its name.  */
        tree elt = TREE_TYPE (t);
-       elt = type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
+       elt = c_common_type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
        dump_type (elt, flags);
       }
       break;
index e9e660dc9722d496d1e749e0692c5b52425242e9..7e442fbc70e10a3adefb5d63dc22b52ba10048e8 100644 (file)
@@ -677,7 +677,7 @@ cxx_init (filename)
 
   /* Create the built-in __null node.  */
   null_node = build_int_2 (0, 0);
-  TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
+  TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0);
   ridpointers[RID_NULL] = null_node;
 
   token_count = init_cpp_parse ();
index ac24b6eb8c6247c5c396efa30736cd93bda956bf..1a1c995bb6d32dd2a80abe284254e96e1584a832 100644 (file)
@@ -1560,7 +1560,8 @@ write_builtin_type (type)
 
          if (itk == itk_none)
            {
-             tree t = type_for_mode (TYPE_MODE (type), TREE_UNSIGNED (type));
+             tree t = c_common_type_for_mode (TYPE_MODE (type),
+                                              TREE_UNSIGNED (type));
              if (type == t)
                {
                  if (TYPE_PRECISION (type) == 128)
index 767f90d72cb99eea692256751d7c4e41869ff99e..1a575f22fcce0871cfa8d092b90fc70ec75ee7cb 100644 (file)
@@ -910,9 +910,9 @@ comptypes (t1, t2, strict)
       /* Treat an enum type as the unsigned integer type of the same width.  */
 
       if (TREE_CODE (t1) == ENUMERAL_TYPE)
-       t1 = type_for_size (TYPE_PRECISION (t1), 1);
+       t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
       if (TREE_CODE (t2) == ENUMERAL_TYPE)
-       t2 = type_for_size (TYPE_PRECISION (t2), 1);
+       t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
 
       if (t1 == t2)
        return 1;
index 9aa5a0a34fd487c7d19229eac732493fd597ac06..3eb31bd0237ec82eef42a28755d3c3009c9ba117 100644 (file)
@@ -396,7 +396,8 @@ init_eh ()
       DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node;
 
       tmp = build_index_type (build_int_2 (4 - 1, 0));
-      tmp = build_array_type (type_for_mode (word_mode, 1), tmp);
+      tmp = build_array_type ((*lang_hooks.types.type_for_mode) (word_mode, 1),
+                             tmp);
       f_data = build_decl (FIELD_DECL, get_identifier ("__data"), tmp);
       DECL_FIELD_CONTEXT (f_data) = sjlj_fc_type_node;
 
index d2edd813c964ea35f15119b4fd593ddcbc873185..cdc403fcc9139cec816ed79b6abb9a9d29095f61 100644 (file)
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "optabs.h"
 #include "real.h"
 #include "recog.h"
+#include "langhooks.h"
 
 static void store_fixed_bit_field      PARAMS ((rtx, unsigned HOST_WIDE_INT,
                                                 unsigned HOST_WIDE_INT,
@@ -4168,9 +4169,10 @@ expand_mult_add (x, target, mult, add, mode, unsignedp)
      enum machine_mode mode;
      int unsignedp;
 {
-  tree type = type_for_mode (mode, unsignedp);
+  tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
   tree add_type = (GET_MODE (add) == VOIDmode
-                  ? type : type_for_mode (GET_MODE (add), unsignedp));
+                  ? type: (*lang_hooks.types.type_for_mode) (GET_MODE (add),
+                                                             unsignedp));
   tree result =  fold (build (PLUS_EXPR, type,
                              fold (build (MULT_EXPR, type,
                                           make_tree (type, x),
index e83e1078bc463706de1367dc4c033843c4ec682c..6587212296e212e7209542dbfef65c1447a99270 100644 (file)
@@ -4027,8 +4027,9 @@ store_expr (exp, target, want_value)
                                          TREE_TYPE (exp)),
                 exp);
 
-         exp = convert (type_for_mode (GET_MODE (SUBREG_REG (target)),
-                                       SUBREG_PROMOTED_UNSIGNED_P (target)),
+         exp = convert ((*lang_hooks.types.type_for_mode)
+                        (GET_MODE (SUBREG_REG (target)),
+                         SUBREG_PROMOTED_UNSIGNED_P (target)),
                         exp);
 
          inner_target = SUBREG_REG (target);
@@ -4526,7 +4527,8 @@ store_constructor (exp, target, cleared, size)
 
              if (TYPE_PRECISION (type) < BITS_PER_WORD)
                {
-                 type = type_for_size (BITS_PER_WORD, TREE_UNSIGNED (type));
+                 type = (*lang_hooks.types.type_for_size)
+                   (BITS_PER_WORD, TREE_UNSIGNED (type));
                  value = convert (type, value);
                }
 
@@ -4955,7 +4957,8 @@ store_constructor (exp, target, cleared, size)
            {
              targetx
                = assign_temp
-                 ((build_qualified_type (type_for_mode (GET_MODE (target), 0),
+                 ((build_qualified_type ((*lang_hooks.types.type_for_mode)
+                                         (GET_MODE (target), 0),
                                          TYPE_QUAL_CONST)),
                   0, 1, 1);
              emit_move_insn (targetx, target);
@@ -7015,7 +7018,8 @@ expand_expr (exp, target, tmode, modifier)
            if (mode == BLKmode)
              {
                rtx new = assign_temp (build_qualified_type
-                                      (type_for_mode (ext_mode, 0),
+                                      ((*lang_hooks.types.type_for_mode)
+                                       (ext_mode, 0),
                                        TYPE_QUAL_CONST), 0, 1, 1);
 
                emit_move_insn (new, op0);
@@ -9252,7 +9256,7 @@ do_jump (exp, if_false_label, if_true_label)
          && TYPE_PRECISION (TREE_TYPE (exp)) <= HOST_BITS_PER_WIDE_INT
          && (i = tree_floor_log2 (TREE_OPERAND (exp, 1))) >= 0
          && (mode = mode_for_size (i + 1, MODE_INT, 0)) != BLKmode
-         && (type = type_for_mode (mode, 1)) != 0
+         && (type = (*lang_hooks.types.type_for_mode) (mode, 1)) != 0
          && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
          && (cmp_optab->handlers[(int) TYPE_MODE (type)].insn_code
              != CODE_FOR_nothing))
@@ -9312,7 +9316,7 @@ do_jump (exp, if_false_label, if_true_label)
        get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode,
                             &unsignedp, &volatilep);
 
-       type = type_for_size (bitsize, unsignedp);
+       type = (*lang_hooks.types.type_for_size) (bitsize, unsignedp);
        if (! SLOW_BYTE_ACCESS
            && type != 0 && bitsize >= 0
            && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
@@ -10393,8 +10397,8 @@ try_casesi (index_type, index_expr, minval, range,
     {
       if (TYPE_MODE (index_type) != index_mode)
        {
-         index_expr = convert (type_for_size (index_bits, 0),
-                               index_expr);
+         index_expr = convert ((*lang_hooks.types.type_for_size)
+                               (index_bits, 0), index_expr);
          index_type = TREE_TYPE (index_expr);
        }
 
index 68c8ade99eed0d5f679d70630c4928dbf05d0381..74202a6f8192f2958a4b4a9f1bbb3c1bb2d95882 100644 (file)
@@ -1,3 +1,11 @@
+Fri Mar 29 21:59:15 2002  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * com.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
+       Redefine.
+       (type_for_mode, type_for_size): Rename.
+       (signed_or_unsigned_type, signed_type, truthvalue_conversion,
+       unsigned_type): Use new hooks.
+
 Tue Mar 26 10:30:05 2002  Andrew Cagney  <ac131313@redhat.com>
 
        * invoke.texi (Warning Options): Mention -Wswitch-enum.
index a2b2e09d1e364cfa764cf45e07d0cda0d017291e..fcff40150e07dfe13047b7bf62d0d41413c4e58b 100644 (file)
@@ -261,6 +261,8 @@ struct _ffecom_concat_list_
 
 /* Static functions (internal). */
 
+static tree ffe_type_for_mode PARAMS ((enum machine_mode, int));
+static tree ffe_type_for_size PARAMS ((unsigned int, int));
 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);
@@ -14225,6 +14227,10 @@ 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
 
 /* 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
@@ -14758,7 +14764,7 @@ signed_or_unsigned_type (unsignedp, type)
     return (unsignedp ? long_long_unsigned_type_node
            : long_long_integer_type_node);
 
-  type2 = type_for_size (TYPE_PRECISION (type), unsignedp);
+  type2 = ffe_type_for_size (TYPE_PRECISION (type), unsignedp);
   if (type2 == NULL_TREE)
     return type;
 
@@ -14794,7 +14800,7 @@ signed_type (type)
     return intQI_type_node;
 #endif
 
-  type2 = type_for_size (TYPE_PRECISION (type1), 0);
+  type2 = ffe_type_for_size (TYPE_PRECISION (type1), 0);
   if (type2 != NULL_TREE)
     return type2;
 
@@ -14992,8 +14998,8 @@ truthvalue_conversion (expr)
                   convert (TREE_TYPE (expr), integer_zero_node));
 }
 
-tree
-type_for_mode (mode, unsignedp)
+static tree
+ffe_type_for_mode (mode, unsignedp)
      enum machine_mode mode;
      int unsignedp;
 {
@@ -15049,8 +15055,8 @@ type_for_mode (mode, unsignedp)
   return 0;
 }
 
-tree
-type_for_size (bits, unsignedp)
+static tree
+ffe_type_for_size (bits, unsignedp)
      unsigned bits;
      int unsignedp;
 {
@@ -15114,7 +15120,7 @@ unsigned_type (type)
     return unsigned_intQI_type_node;
 #endif
 
-  type2 = type_for_size (TYPE_PRECISION (type1), 1);
+  type2 = ffe_type_for_size (TYPE_PRECISION (type1), 1);
   if (type2 != NULL_TREE)
     return type2;
 
index 4c5b91ed11eed82298e42399e90a18bfc1fff2fa..875ade3bf75a31dcc1a108289af3490480e22aa3 100644 (file)
@@ -2426,8 +2426,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
 
   /* Set signed and unsigned types of the precision of this mode for the
      shifts below.  */
-  signed_type = type_for_mode (nmode, 0);
-  unsigned_type = type_for_mode (nmode, 1);
+  signed_type = (*lang_hooks.types.type_for_mode) (nmode, 0);
+  unsigned_type = (*lang_hooks.types.type_for_mode) (nmode, 1);
 
   /* Compute the bit position and size for the new reference and our offset
      within it. If the new reference is the same size as the original, we
@@ -2590,7 +2590,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
     return 0;
 
   /* Compute the mask to access the bitfield.  */
-  unsigned_type = type_for_size (*pbitsize, 1);
+  unsigned_type = (*lang_hooks.types.type_for_size) (*pbitsize, 1);
   precision = TYPE_PRECISION (unsigned_type);
 
   mask = build_int_2 (~0, ~0);
@@ -2960,7 +2960,8 @@ make_range (exp, pin_p, plow, phigh)
             be interpreted as positive.  */
          if (TREE_UNSIGNED (type) && ! TREE_UNSIGNED (TREE_TYPE (exp)))
            {
-             tree equiv_type = type_for_mode (TYPE_MODE (type), 1);
+             tree equiv_type = (*lang_hooks.types.type_for_mode)
+               (TYPE_MODE (type), 1);
              tree high_positive;
 
              /* A range without an upper bound is, naturally, unbounded.
@@ -3509,7 +3510,7 @@ fold_truthop (code, truth_type, lhs, rhs)
 
   lnbitsize = GET_MODE_BITSIZE (lnmode);
   lnbitpos = first_bit & ~ (lnbitsize - 1);
-  lntype = type_for_size (lnbitsize, 1);
+  lntype = (*lang_hooks.types.type_for_size) (lnbitsize, 1);
   xll_bitpos = ll_bitpos - lnbitpos, xrl_bitpos = rl_bitpos - lnbitpos;
 
   if (BYTES_BIG_ENDIAN)
@@ -3580,7 +3581,7 @@ fold_truthop (code, truth_type, lhs, rhs)
 
       rnbitsize = GET_MODE_BITSIZE (rnmode);
       rnbitpos = first_bit & ~ (rnbitsize - 1);
-      rntype = type_for_size (rnbitsize, 1);
+      rntype = (*lang_hooks.types.type_for_size) (rnbitsize, 1);
       xlr_bitpos = lr_bitpos - rnbitpos, xrr_bitpos = rr_bitpos - rnbitpos;
 
       if (BYTES_BIG_ENDIAN)
@@ -5720,7 +5721,7 @@ fold (expr)
                        || integer_onep (folded_compare))
                      return omit_one_operand (type, folded_compare, varop);
 
-                   unsigned_type = type_for_size (size, 1);
+                   unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
                    precision = TYPE_PRECISION (unsigned_type);
                    mask = build_int_2 (~0, ~0);
                    TREE_TYPE (mask) = unsigned_type;
@@ -5781,7 +5782,7 @@ fold (expr)
                        || integer_onep (folded_compare))
                      return omit_one_operand (type, folded_compare, varop);
 
-                   unsigned_type = type_for_size (size, 1);
+                   unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
                    precision = TYPE_PRECISION (unsigned_type);
                    mask = build_int_2 (~0, ~0);
                    TREE_TYPE (mask) = TREE_TYPE (varop);
index e7facd453b7de26a3618cbdc28ce283a4b49da60..a17b249661fb584f307ef7a5195864077b9c31ed 100644 (file)
@@ -556,7 +556,7 @@ assign_stack_local_1 (mode, size, align, function)
 
       /* Allow the target to (possibly) increase the alignment of this
         stack slot.  */
-      type = type_for_mode (mode, 0);
+      type = (*lang_hooks.types.type_for_mode) (mode, 0);
       if (type)
        alignment = LOCAL_ALIGNMENT (type, alignment);
 
@@ -675,7 +675,7 @@ assign_stack_temp_for_type (mode, size, keep, type)
     align = GET_MODE_ALIGNMENT (mode);
 
   if (! type)
-    type = type_for_mode (mode, 0);
+    type = (*lang_hooks.types.type_for_mode) (mode, 0);
 
   if (type)
     align = LOCAL_ALIGNMENT (type, align);
@@ -1415,7 +1415,7 @@ put_var_into_stack (decl)
         to the whole CONCAT, lest we do double fixups for the latter
         references.  */
       enum machine_mode part_mode = GET_MODE (XEXP (reg, 0));
-      tree part_type = type_for_mode (part_mode, 0);
+      tree part_type = (*lang_hooks.types.type_for_mode) (part_mode, 0);
       rtx lopart = XEXP (reg, 0);
       rtx hipart = XEXP (reg, 1);
 #ifdef FRAME_GROWS_DOWNWARD
index 3006c856672c28c5225e49a609986f25df9d5935..b4ffd1988e3826f0333daf47379a9754f138d480 100644 (file)
@@ -1,3 +1,14 @@
+2002-03-29  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * Make-lang.in (builtins.o): Update.
+       * boehm.c (get_boehm_type_descriptor): Update.
+       * builtins.c: Include langhooks.h.
+       * decl.c (java_init_decl_processing): Update.
+       * java-tree.h (java_type_for_mode, java_type_for_size): New.
+       * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
+       Redefine.
+       * typeck.c (type_for_mode, type_for_size): Update.
+
 2002-03-29  Martin Kahlert  <martin.kahlert@infineon.com>
 
        * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
index 9165a09fa90958a3b7ac7ac421516b11b2210700..00185e5824ba606571f746b89b6e10c48d0a2409 100644 (file)
@@ -261,7 +261,7 @@ java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(JAVA_TREE_H) \
   java/parse.h toplev.h
 java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h
 java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \
-  $(GGC_H) flags.h
+  $(GGC_H) flags.h builtin-types.def langhooks.h
 java/check-init.o: java/check-init.c $(CONFIG_H) \
   $(JAVA_TREE_H) $(SYSTEM_H) toplev.h
 java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
index 3eb20434d26f43f1bc231f65ac7e122c12dca16d..566655a6c96b66acfc1f7635d917e603bf7a490b 100644 (file)
@@ -230,6 +230,6 @@ get_boehm_type_descriptor (tree type)
       value = build_int_2 (2, 0);
     }
 
-  TREE_TYPE (value) = type_for_mode (ptr_mode, 1);
+  TREE_TYPE (value) = java_type_for_mode (ptr_mode, 1);
   return value;
 }
index 7af0435dda6ab291efb2b8005bdc6631e412ddbd..81be7e3d4576dbb3c0b10703500534bdc73f7a19 100644 (file)
@@ -30,7 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "tree.h"
 #include "ggc.h"
 #include "flags.h"
-
+#include "langhooks.h"
 #include "java-tree.h"
 
 enum builtin_type 
index a0a77b26d9bfa0b5582f26f44e14f4f7b0856ab6..c0560c6dbb76917bc6692c2a3bb1a87a3d3f67cc 100644 (file)
@@ -441,7 +441,7 @@ java_init_decl_processing ()
   set_sizetype (make_unsigned_type (POINTER_SIZE));
 
   /* Define these next since types below may used them.  */
-  integer_type_node = type_for_size (INT_TYPE_SIZE, 0);
+  integer_type_node = java_type_for_size (INT_TYPE_SIZE, 0);
   integer_zero_node = build_int_2 (0, 0);
   integer_one_node = build_int_2 (1, 0);
   integer_two_node = build_int_2 (2, 0);
index cf272fd6320f3e6b412416f1ae3e19ec93600905..3f47430aa4038e3129b80ec7b553046b70437e8c 100644 (file)
@@ -1039,6 +1039,8 @@ struct lang_type
 extern void java_set_yydebug PARAMS ((int));
 extern void java_parse_file PARAMS ((void));
 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 void add_assume_compiled PARAMS ((const char *, int));
 extern tree lookup_class PARAMS ((tree));
 extern tree lookup_java_constructor PARAMS ((tree, tree));
index fd197235cd42f02a469419617696145475d6343f..583af75eaf1ba5d1efaef8c1877a339c4256f12b 100644 (file)
@@ -231,6 +231,10 @@ 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
 
 /* Each front end provides its own.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
index 34dbc2e2ba73547dee40fca0831aacc1c857c770..88f3fb9f3cad4e126d067d37f271fbfa657e8e8c 100644 (file)
@@ -183,7 +183,7 @@ incomplete_type_error (value, type)
    then UNSIGNEDP selects between signed and unsigned types.  */
 
 tree
-type_for_mode (mode, unsignedp)
+java_type_for_mode (mode, unsignedp)
      enum machine_mode mode;
      int unsignedp;
 {
@@ -207,7 +207,7 @@ type_for_mode (mode, unsignedp)
    that is unsigned if UNSIGNEDP is nonzero, otherwise signed.  */
 
 tree
-type_for_size (bits, unsignedp)
+java_type_for_size (bits, unsignedp)
      unsigned bits;
      int unsignedp;
 {
index 821def7940286a53843761d42d1db919c128bbc9..8679f235c9a9b201dc5f3b1cabfd7c5e3b0cad68 100644 (file)
@@ -145,11 +145,14 @@ int lhd_tree_dump_type_quals                      PARAMS ((tree));
   LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
 }
 
-/* Types hooks.  */
+/* Types hooks.  No default for LANG_HOOKS_TYPE_FOR_MODE or
+   LANG_HOOKS_TYPE_FOR_SIZE.  */
 #define LANG_HOOKS_MAKE_TYPE make_node
 
 #define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
-  LANG_HOOKS_MAKE_TYPE \
+  LANG_HOOKS_MAKE_TYPE, \
+  LANG_HOOKS_TYPE_FOR_MODE, \
+  LANG_HOOKS_TYPE_FOR_SIZE \
 }
 
 /* Declaration hooks.  */
index 88a45f969ae0d2ec5704a479dd12d95ce5a657a2..df404c532540e98b09d82d5b37cd5b49e605e6ae 100644 (file)
@@ -71,7 +71,17 @@ struct lang_hooks_for_tree_dump
 
 struct lang_hooks_for_types
 {
+  /* Return a new type (with the indicated CODE), doing whatever
+     language-specific processing is required.  */
   tree (*make_type) PARAMS ((enum tree_code));
+  
+  /* Given MODE and UNSIGNEDP, return a suitable type-tree with that
+     mode.  */
+  tree (*type_for_mode) PARAMS ((enum machine_mode, int));
+
+  /* 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));
 };
 
 /* Language hooks related to decls and the symbol table.  */
index cfc47024bf532ee139ee77d53a8a587799dbc160..827a5a7166f4dd82ae30447abd5e99d5c555917f 100644 (file)
@@ -8306,7 +8306,7 @@ handle_impent (impent)
       tree decl, init;
 
       init = build_int_2 (0, 0);
-      TREE_TYPE (init) = type_for_size (BITS_PER_WORD, 1);
+      TREE_TYPE (init) = c_common_type_for_size (BITS_PER_WORD, 1);
       decl = build_decl (VAR_DECL, get_identifier (string), TREE_TYPE (init));
       TREE_PUBLIC (decl) = 1;
       TREE_READONLY (decl) = 1;
index b189d6bfe93a349f221b073dd33afad84e82ab8e..aa7e308ecbdc42d947725d443e43fb3523f7210d 100644 (file)
@@ -76,6 +76,11 @@ static void objc_post_options                   PARAMS ((void));
 #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
   c_convert_parm_for_inlining
 
+#undef LANG_HOOKS_TYPE_FOR_MODE
+#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
+
 /* Each front end provides its own hooks, for toplev.c.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
index fcda52d53249d4664c4e23726567f254e182f0ce..d732047aaf87dfda074c93d61b1cdf1940c0a635 100644 (file)
@@ -4115,7 +4115,8 @@ expand_decl_cleanup (decl, cleanup)
 
          emit_move_insn (flag, const1_rtx);
 
-         cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
+         cond = build_decl (VAR_DECL, NULL_TREE,
+                            (*lang_hooks.types.type_for_mode) (word_mode, 1));
          SET_DECL_RTL (cond, flag);
 
          /* Conditionalize the cleanup.  */
@@ -6310,7 +6311,7 @@ emit_case_nodes (index, node, default_label, index_type)
          else if (!low_bound && !high_bound)
            {
              /* Widen LOW and HIGH to the same width as INDEX.  */
-             tree type = type_for_mode (mode, unsignedp);
+             tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
              tree low = build1 (CONVERT_EXPR, type, node->low);
              tree high = build1 (CONVERT_EXPR, type, node->high);
              rtx low_rtx, new_index, new_bound;
index 1b5bddda152a7038e3ccae3061724eec7a915914..98ac6bc663bad8d369a52ca769fb4eb5c5832695 100644 (file)
@@ -4024,8 +4024,8 @@ get_unwidened (op, for_type)
     {
       unsigned int innerprec
        = tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
-
-      type = type_for_size (innerprec, TREE_UNSIGNED (TREE_OPERAND (op, 1)));
+      int unsignedp = TREE_UNSIGNED (TREE_OPERAND (op, 1));
+      type = (*lang_hooks.types.type_for_size) (innerprec, unsignedp);
 
       /* We can get this structure field in the narrowest type it fits in.
         If FOR_TYPE is 0, do this only for a field that matches the
@@ -4035,8 +4035,7 @@ get_unwidened (op, for_type)
 
       if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
          && (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)))
-         && (! uns || final_prec <= innerprec
-             || TREE_UNSIGNED (TREE_OPERAND (op, 1)))
+         && (! uns || final_prec <= innerprec || unsignedp)
          && type != 0)
        {
          win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0),
@@ -4110,7 +4109,8 @@ get_narrower (op, unsignedp_ptr)
     {
       unsigned HOST_WIDE_INT innerprec
        = tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
-      tree type = type_for_size (innerprec, TREE_UNSIGNED (op));
+      tree type = (*lang_hooks.types.type_for_size) (innerprec,
+                                                    TREE_UNSIGNED (op));
 
       /* We can get this structure field in a narrower type that fits it,
         but the resulting extension to its nominal type (a fullword type)
index c40b611d018c5ecd121acb45a8b206951809ba8b..58b2ebae4103bc2aec2c36048e2be8f7f291dfb4 100644 (file)
@@ -2611,20 +2611,6 @@ extern tree get_unwidened                PARAMS ((tree, tree));
 
 extern tree get_narrower               PARAMS ((tree, int *));
 
-/* Given MODE and UNSIGNEDP, return a suitable type-tree
-   with that mode.
-   The definition of this resides in language-specific code
-   as the repertoire of available types may vary.  */
-
-extern tree type_for_mode              PARAMS ((enum machine_mode, int));
-
-/* Given PRECISION and UNSIGNEDP, return a suitable type-tree
-   for an integer type with at least that precision.
-   The definition of this resides in language-specific code
-   as the repertoire of available types may vary.  */
-
-extern 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.
    The definition of this resides in language-specific code
index ad0ef708abf7b02abb030432b1ecc9dbacf47c1e..fc45cd8b0d0092c7366107836dc096a57c55ee7a 100644 (file)
@@ -3799,7 +3799,8 @@ force_const_mem (mode, x)
   /* Align the location counter as required by EXP's data type.  */
   align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
 #ifdef CONSTANT_ALIGNMENT
-  align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x), align);
+  align = CONSTANT_ALIGNMENT (make_tree ((*lang_hooks.types.type_for_mode)
+                                        (mode, 0), x), align);
 #endif
 
   pool_offset += (align / BITS_PER_UNIT) - 1;
@@ -3837,7 +3838,7 @@ force_const_mem (mode, x)
   pool->desc->rtl = def
     = gen_rtx_MEM (mode, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label)));
   set_mem_alias_set (def, const_alias_set);
-  set_mem_attributes (def, type_for_mode (mode, 0), 1);
+  set_mem_attributes (def, (*lang_hooks.types.type_for_mode) (mode, 0), 1);
   RTX_UNCHANGING_P (def) = 1;
 
   /* Add label to symbol hash table.  */