aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-03-29 21:46:27 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-03-29 21:46:27 +0000
commitb0c48229854447bec65f7f5a6ef1dbbe451cc3fb (patch)
treee8a67fcfa0ef3614bf38b6f84422372f82aa6004 /gcc/ada/utils.c
parentd52e4867caba3a5833cc2c90ac8df8fe7ccd7b76 (diff)
downloadgcc-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/ada/utils.c')
-rw-r--r--gcc/ada/utils.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 776fbbe..d01e7d8 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -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);
}
/* 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,