diff options
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 0e4099c..b92531b 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -771,7 +771,7 @@ make_aligning_type (tree type, unsigned int align, tree size, tree make_packable_type (tree type, bool in_record) { - unsigned HOST_WIDE_INT size = tree_low_cst (TYPE_SIZE (type), 1); + unsigned HOST_WIDE_INT size = tree_to_uhwi (TYPE_SIZE (type)); unsigned HOST_WIDE_INT new_size; tree new_type, old_field, field_list = NULL_TREE; unsigned int align; @@ -918,7 +918,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased) if (!size_tree || !tree_fits_uhwi_p (size_tree)) return type; - size = tree_low_cst (size_tree, 1); + size = tree_to_uhwi (size_tree); switch (TREE_CODE (type)) { @@ -1744,7 +1744,7 @@ rest_of_record_type_compilation (tree record_type) && tree_fits_uhwi_p (TREE_OPERAND (curpos, 1))) { tree offset = TREE_OPERAND (curpos, 0); - align = tree_low_cst (TREE_OPERAND (curpos, 1), 1); + align = tree_to_uhwi (TREE_OPERAND (curpos, 1)); align = scale_by_factor_of (offset, align); last_pos = round_up (last_pos, align); pos = compute_related_constant (curpos, last_pos); @@ -1758,9 +1758,9 @@ rest_of_record_type_compilation (tree record_type) { tree offset = TREE_OPERAND (TREE_OPERAND (curpos, 0), 0); unsigned HOST_WIDE_INT addend - = tree_low_cst (TREE_OPERAND (curpos, 1), 1); + = tree_to_uhwi (TREE_OPERAND (curpos, 1)); align - = tree_low_cst (TREE_OPERAND (TREE_OPERAND (curpos, 0), 1), 1); + = tree_to_uhwi (TREE_OPERAND (TREE_OPERAND (curpos, 0), 1)); align = scale_by_factor_of (offset, align); align = MIN (align, addend & -addend); last_pos = round_up (last_pos, align); @@ -2378,7 +2378,7 @@ create_field_decl (tree field_name, tree field_type, tree record_type, unsigned int known_align; if (tree_fits_uhwi_p (pos)) - known_align = tree_low_cst (pos, 1) & - tree_low_cst (pos, 1); + known_align = tree_to_uhwi (pos) & - tree_to_uhwi (pos); else known_align = BITS_PER_UNIT; @@ -2549,7 +2549,7 @@ bool value_factor_p (tree value, HOST_WIDE_INT factor) { if (tree_fits_uhwi_p (value)) - return tree_low_cst (value, 1) % factor == 0; + return tree_to_uhwi (value) % factor == 0; if (TREE_CODE (value) == MULT_EXPR) return (value_factor_p (TREE_OPERAND (value, 0), factor) @@ -2616,8 +2616,8 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset) iff it is not multiple of the current field alignment. */ if (tree_fits_uhwi_p (DECL_SIZE (prev_field)) && tree_fits_uhwi_p (bit_position (prev_field))) - return ((tree_low_cst (bit_position (prev_field), 1) - + tree_low_cst (DECL_SIZE (prev_field), 1)) + return ((tree_to_uhwi (bit_position (prev_field)) + + tree_to_uhwi (DECL_SIZE (prev_field))) % DECL_ALIGN (curr_field) != 0); /* If both the position and size of the previous field are multiples @@ -3274,7 +3274,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) case ENUMERAL_TYPE: case BOOLEAN_TYPE: if (TYPE_VAX_FLOATING_POINT_P (type)) - switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) + switch (tree_to_uhwi (TYPE_DIGITS_VALUE (type))) { case 6: dtype = 10; @@ -3314,7 +3314,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) case COMPLEX_TYPE: if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE && TYPE_VAX_FLOATING_POINT_P (type)) - switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) + switch (tree_to_uhwi (TYPE_DIGITS_VALUE (type))) { case 6: dtype = 12; @@ -3575,7 +3575,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) case ENUMERAL_TYPE: case BOOLEAN_TYPE: if (TYPE_VAX_FLOATING_POINT_P (type)) - switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) + switch (tree_to_uhwi (TYPE_DIGITS_VALUE (type))) { case 6: dtype = 10; @@ -3615,7 +3615,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) case COMPLEX_TYPE: if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE && TYPE_VAX_FLOATING_POINT_P (type)) - switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1)) + switch (tree_to_uhwi (TYPE_DIGITS_VALUE (type))) { case 6: dtype = 12; @@ -6310,7 +6310,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, } /* Get the vector size (in bytes). */ - vecsize = tree_low_cst (size, 1); + vecsize = tree_to_uhwi (size); /* We need to provide for vector pointers, vector arrays, and functions returning vectors. For example: @@ -6342,7 +6342,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, return NULL_TREE; } - if (vecsize % tree_low_cst (TYPE_SIZE_UNIT (type), 1)) + if (vecsize % tree_to_uhwi (TYPE_SIZE_UNIT (type))) { error ("vector size not an integral multiple of component size"); return NULL; @@ -6355,7 +6355,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, } /* Calculate how many units fit in the vector. */ - nunits = vecsize / tree_low_cst (TYPE_SIZE_UNIT (type), 1); + nunits = vecsize / tree_to_uhwi (TYPE_SIZE_UNIT (type)); if (nunits & (nunits - 1)) { error ("number of components of the vector not a power of two"); @@ -6427,9 +6427,9 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args), /* Sanity check the vector size and element type consistency. */ - vec_bytes = tree_low_cst (rep_size, 1); + vec_bytes = tree_to_uhwi (rep_size); - if (vec_bytes % tree_low_cst (TYPE_SIZE_UNIT (elem_type), 1)) + if (vec_bytes % tree_to_uhwi (TYPE_SIZE_UNIT (elem_type))) { error ("vector size not an integral multiple of component size"); return NULL; @@ -6441,7 +6441,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args), return NULL; } - vec_units = vec_bytes / tree_low_cst (TYPE_SIZE_UNIT (elem_type), 1); + vec_units = vec_bytes / tree_to_uhwi (TYPE_SIZE_UNIT (elem_type)); if (vec_units & (vec_units - 1)) { error ("number of components of the vector not a power of two"); |