summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c152
1 files changed, 76 insertions, 76 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index ea3f7368480..7734fddde5e 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1017,33 +1017,33 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special,
bool has_rep)
{
tree type = TREE_TYPE (last_size);
- tree new;
+ tree new_tree;
if (!special || TREE_CODE (size) != COND_EXPR)
{
- new = size_binop (PLUS_EXPR, first_bit, size);
+ new_tree = size_binop (PLUS_EXPR, first_bit, size);
if (has_rep)
- new = size_binop (MAX_EXPR, last_size, new);
+ new_tree = size_binop (MAX_EXPR, last_size, new_tree);
}
else
- new = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0),
- integer_zerop (TREE_OPERAND (size, 1))
- ? last_size : merge_sizes (last_size, first_bit,
- TREE_OPERAND (size, 1),
- 1, has_rep),
- integer_zerop (TREE_OPERAND (size, 2))
- ? last_size : merge_sizes (last_size, first_bit,
- TREE_OPERAND (size, 2),
- 1, has_rep));
+ new_tree = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0),
+ integer_zerop (TREE_OPERAND (size, 1))
+ ? last_size : merge_sizes (last_size, first_bit,
+ TREE_OPERAND (size, 1),
+ 1, has_rep),
+ integer_zerop (TREE_OPERAND (size, 2))
+ ? last_size : merge_sizes (last_size, first_bit,
+ TREE_OPERAND (size, 2),
+ 1, has_rep));
/* We don't need any NON_VALUE_EXPRs and they can confuse us (especially
when fed through substitute_in_expr) into thinking that a constant
size is not constant. */
- while (TREE_CODE (new) == NON_LVALUE_EXPR)
- new = TREE_OPERAND (new, 0);
+ while (TREE_CODE (new_tree) == NON_LVALUE_EXPR)
+ new_tree = TREE_OPERAND (new_tree, 0);
- return new;
+ return new_tree;
}
/* Utility function of above to see if OP0 and OP1, both of SIZETYPE, are
@@ -1163,18 +1163,18 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list,
tree
copy_type (tree type)
{
- tree new = copy_node (type);
+ tree new_tree = copy_node (type);
/* copy_node clears this field instead of copying it, because it is
aliased with TREE_CHAIN. */
- TYPE_STUB_DECL (new) = TYPE_STUB_DECL (type);
+ TYPE_STUB_DECL (new_tree) = TYPE_STUB_DECL (type);
- TYPE_POINTER_TO (new) = 0;
- TYPE_REFERENCE_TO (new) = 0;
- TYPE_MAIN_VARIANT (new) = new;
- TYPE_NEXT_VARIANT (new) = 0;
+ TYPE_POINTER_TO (new_tree) = 0;
+ TYPE_REFERENCE_TO (new_tree) = 0;
+ TYPE_MAIN_VARIANT (new_tree) = new_tree;
+ TYPE_NEXT_VARIANT (new_tree) = 0;
- return new;
+ return new_tree;
}
/* Return a subtype of sizetype with range MIN to MAX and whose
@@ -2515,7 +2515,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
tree record_type = make_node (RECORD_TYPE);
tree pointer32_type;
tree field_list = 0;
- int class;
+ int class_i;
int dtype = 0;
tree inner_type;
int ndim;
@@ -2627,22 +2627,22 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
case By_Descriptor_A:
case By_Short_Descriptor_A:
- class = 4;
+ class_i = 4;
break;
case By_Descriptor_NCA:
case By_Short_Descriptor_NCA:
- class = 10;
+ class_i = 10;
break;
case By_Descriptor_SB:
case By_Short_Descriptor_SB:
- class = 15;
+ class_i = 15;
break;
case By_Descriptor:
case By_Short_Descriptor:
case By_Descriptor_S:
case By_Short_Descriptor_S:
default:
- class = 1;
+ class_i = 1;
break;
}
@@ -2664,7 +2664,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
field_list = chainon (field_list,
make_descriptor_field ("CLASS",
gnat_type_for_size (8, 1),
- record_type, size_int (class)));
+ record_type, size_int (class_i)));
/* Of course this will crash at run-time if the address space is not
within the low 32 bits, but there is nothing else we can do. */
@@ -2830,7 +2830,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
tree record64_type = make_node (RECORD_TYPE);
tree pointer64_type;
tree field_list64 = 0;
- int class;
+ int class_i;
int dtype = 0;
tree inner_type;
int ndim;
@@ -2941,18 +2941,18 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
switch (mech)
{
case By_Descriptor_A:
- class = 4;
+ class_i = 4;
break;
case By_Descriptor_NCA:
- class = 10;
+ class_i = 10;
break;
case By_Descriptor_SB:
- class = 15;
+ class_i = 15;
break;
case By_Descriptor:
case By_Descriptor_S:
default:
- class = 1;
+ class_i = 1;
break;
}
@@ -2971,7 +2971,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
field_list64 = chainon (field_list64,
make_descriptor_field ("CLASS",
gnat_type_for_size (8, 1),
- record64_type, size_int (class)));
+ record64_type, size_int (class_i)));
field_list64 = chainon (field_list64,
make_descriptor_field ("MBMO",
@@ -3154,9 +3154,9 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */
- tree class = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+ tree class_tree = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
/* The POINTER field is the 6th field in the descriptor. */
- tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (class)));
+ tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (class_tree)));
/* Retrieve the value of the POINTER field. */
tree gnu_expr64
@@ -3172,9 +3172,9 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
- tree template, template_addr, aflags, dimct, t, u;
+ tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */
- int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
+ int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class_tree));
tree lfield, ufield;
/* Convert POINTER to the type of the P_ARRAY field. */
@@ -3185,23 +3185,23 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
case 1: /* Class S */
case 15: /* Class SB */
/* Build {1, LENGTH} template; LENGTH64 is the 5th field. */
- t = TREE_CHAIN (TREE_CHAIN (class));
+ t = TREE_CHAIN (TREE_CHAIN (class_tree));
t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
t = tree_cons (min_field,
convert (TREE_TYPE (min_field), integer_one_node),
tree_cons (max_field,
convert (TREE_TYPE (max_field), t),
NULL_TREE));
- template = gnat_build_constructor (template_type, t);
- template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
+ template_tree = gnat_build_constructor (template_type, t);
+ template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
/* For class S, we are done. */
if (iclass == 1)
break;
/* Test that we really have a SB descriptor, like DEC Ada. */
- t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL);
- u = convert (TREE_TYPE (class), DECL_INITIAL (class));
+ t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, NULL);
+ u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
/* If so, there is already a template in the descriptor and
it is located right after the POINTER field. The fields are
@@ -3219,12 +3219,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = tree_cons (TYPE_FIELDS (template_type), lfield,
tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
ufield, NULL_TREE));
- template = gnat_build_constructor (template_type, t);
+ template_tree = gnat_build_constructor (template_type, t);
/* Otherwise use the {1, LENGTH} template we build above. */
template_addr = build3 (COND_EXPR, p_bounds_type, u,
build_unary_op (ADDR_EXPR, p_bounds_type,
- template),
+ template_tree),
template_addr);
break;
@@ -3266,12 +3266,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
t = tree_cons (TYPE_FIELDS (template_type), lfield,
tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
ufield, NULL_TREE));
- template = gnat_build_constructor (template_type, t);
- template = build3 (COND_EXPR, p_bounds_type, u,
+ template_tree = gnat_build_constructor (template_type, t);
+ template_tree = build3 (COND_EXPR, p_bounds_type, u,
build_call_raise (CE_Length_Check_Failed, Empty,
N_Raise_Constraint_Error),
- template);
- template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
+ template_tree);
+ template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template_tree);
break;
case 10: /* Class NCA */
@@ -3302,9 +3302,9 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */
- tree class = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+ tree class_tree = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
/* The POINTER field is the 4th field in the descriptor. */
- tree pointer = TREE_CHAIN (class);
+ tree pointer = TREE_CHAIN (class_tree);
/* Retrieve the value of the POINTER field. */
tree gnu_expr32
@@ -3320,9 +3320,9 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
- tree template, template_addr, aflags, dimct, t, u;
+ tree template_tree, template_addr, aflags, dimct, t, u;
/* See the head comment of build_vms_descriptor. */
- int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
+ int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class_tree));
/* Convert POINTER to the type of the P_ARRAY field. */
gnu_expr32 = convert (p_array_type, gnu_expr32);
@@ -3339,25 +3339,25 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree_cons (max_field,
convert (TREE_TYPE (max_field), t),
NULL_TREE));
- template = gnat_build_constructor (template_type, t);
- template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
+ template_tree = gnat_build_constructor (template_type, t);
+ template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
/* For class S, we are done. */
if (iclass == 1)
break;
/* Test that we really have a SB descriptor, like DEC Ada. */
- t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL);
- u = convert (TREE_TYPE (class), DECL_INITIAL (class));
+ t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, NULL);
+ u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
/* If so, there is already a template in the descriptor and
it is located right after the POINTER field. */
t = TREE_CHAIN (pointer);
- template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ template_tree = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
/* Otherwise use the {1, LENGTH} template we build above. */
template_addr = build3 (COND_EXPR, p_bounds_type, u,
build_unary_op (ADDR_EXPR, p_bounds_type,
- template),
+ template_tree),
template_addr);
break;
@@ -3384,12 +3384,12 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* There is already a template in the descriptor and it is
located at the start of block 3 (12th field). */
t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t))));
- template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
- template = build3 (COND_EXPR, p_bounds_type, u,
+ template_tree = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ template_tree = build3 (COND_EXPR, p_bounds_type, u,
build_call_raise (CE_Length_Check_Failed, Empty,
N_Raise_Constraint_Error),
- template);
- template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
+ template_tree);
+ template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template_tree);
break;
case 10: /* Class NCA */
@@ -3720,7 +3720,7 @@ convert_to_fat_pointer (tree type, tree expr)
tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
tree etype = TREE_TYPE (expr);
- tree template;
+ tree template_tree;
/* If EXPR is null, make a fat pointer that contains null pointers to the
template and array. */
@@ -3746,7 +3746,7 @@ convert_to_fat_pointer (tree type, tree expr)
else
expr = build1 (INDIRECT_REF, TREE_TYPE (etype), expr);
- template = build_component_ref (expr, NULL_TREE, fields, false);
+ template_tree = build_component_ref (expr, NULL_TREE, fields, false);
expr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_component_ref (expr, NULL_TREE,
TREE_CHAIN (fields), false));
@@ -3754,7 +3754,7 @@ convert_to_fat_pointer (tree type, tree expr)
/* Otherwise, build the constructor for the template. */
else
- template = build_template (template_type, TREE_TYPE (etype), expr);
+ template_tree = build_template (template_type, TREE_TYPE (etype), expr);
/* The final result is a constructor for the fat pointer.
@@ -3774,7 +3774,7 @@ convert_to_fat_pointer (tree type, tree expr)
tree_cons (TYPE_FIELDS (type),
convert (p_array_type, expr),
tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
- build_unary_op (ADDR_EXPR, NULL_TREE, template),
+ build_unary_op (ADDR_EXPR, NULL_TREE, template_tree),
NULL_TREE)));
}
@@ -4304,20 +4304,20 @@ tree
maybe_unconstrained_array (tree exp)
{
enum tree_code code = TREE_CODE (exp);
- tree new;
+ tree new_tree;
switch (TREE_CODE (TREE_TYPE (exp)))
{
case UNCONSTRAINED_ARRAY_TYPE:
if (code == UNCONSTRAINED_ARRAY_REF)
{
- new
+ new_tree
= build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (exp, 0),
get_identifier ("P_ARRAY"),
NULL_TREE, false));
- TREE_READONLY (new) = TREE_STATIC (new) = TREE_READONLY (exp);
- return new;
+ TREE_READONLY (new_tree) = TREE_STATIC (new_tree) = TREE_READONLY (exp);
+ return new_tree;
}
else if (code == NULL_EXPR)
@@ -4331,12 +4331,12 @@ maybe_unconstrained_array (tree exp)
it contains a template. */
if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
{
- new = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
- if (TREE_CODE (TREE_TYPE (new)) == RECORD_TYPE
- && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new)))
+ new_tree = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
+ if (TREE_CODE (TREE_TYPE (new_tree)) == RECORD_TYPE
+ && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new_tree)))
return
- build_component_ref (new, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))),
+ build_component_ref (new_tree, NULL_TREE,
+ TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new_tree))),
0);
}
else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))