diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-03-29 21:46:27 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-03-29 21:46:27 +0000 |
commit | b0c48229854447bec65f7f5a6ef1dbbe451cc3fb (patch) | |
tree | e8a67fcfa0ef3614bf38b6f84422372f82aa6004 /gcc/cp | |
parent | d52e4867caba3a5833cc2c90ac8df8fe7ccd7b76 (diff) | |
download | gcc-b0c48229854447bec65f7f5a6ef1dbbe451cc3fb.zip gcc-b0c48229854447bec65f7f5a6ef1dbbe451cc3fb.tar.gz gcc-b0c48229854447bec65f7f5a6ef1dbbe451cc3fb.tar.bz2 |
Makefile.in (convert.o, [...]): Update.
* 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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 4 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/error.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 2 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 |
8 files changed, 25 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b7f8cb2..8dd802c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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: diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index a3ede8d..5cd481d 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -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; diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index cea204e..d934df0 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -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; } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1739771..8ba011e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 812def9..b411d27 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index e9e660d..7e442fb 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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 (); diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index ac24b6e..1a1c995 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -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) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 767f90d..1a575f2 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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; |