diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-29 21:46:27 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-29 21:46:27 +0000 |
commit | 771d21fab6794ddeb9c317b7e6fd7e47ef70985a (patch) | |
tree | e8a67fcfa0ef3614bf38b6f84422372f82aa6004 /gcc/convert.c | |
parent | ae8cbbc840e99bad6daf843f557d9e0c0452833b (diff) | |
download | gcc-771d21fab6794ddeb9c317b7e6fd7e47ef70985a.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51571 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 127b22b7eef..25aae573cac 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -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. |