Commit 6bf68a93 by Laurent GUERBY Committed by Laurent Guerby

tb-gcc.c (trace_callback): Use char* instead of void*.

2009-06-26  Laurent GUERBY  <laurent@guerby.net>

	* tb-gcc.c (trace_callback): Use char* instead of void*.
	* gcc-interface/misc.c (enumerate_modes): Make loop compatible
	with C++.
	* gcc-interface/trans.c (parm_attr): Rename to parm_attr_d. 
	Change all uses.
	* gcc-interface/utils.c (new, class, template): Rename to be
	compatible with C++. Change all uses.
	* gcc-interface/decl.c (new): Likewise.

From-SVN: r148975
parent bae4cf87
2009-06-26 Laurent GUERBY <laurent@guerby.net>
* tb-gcc.c (trace_callback): Use char* instead of void*.
* gcc-interface/misc.c (enumerate_modes): Make loop compatible
with C++.
* gcc-interface/trans.c (parm_attr): Rename to parm_attr_d.
Change all uses.
* gcc-interface/utils.c (new, class, template): Rename to be
compatible with C++. Change all uses.
* gcc-interface/decl.c (new): Likewise.
2009-06-26 Eric Botcazou <ebotcazou@adacore.com> 2009-06-26 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (cannot_be_superflat_p): New predicate. * gcc-interface/decl.c (cannot_be_superflat_p): New predicate.
......
...@@ -7840,7 +7840,7 @@ compatible_signatures_p (tree ftype1, tree ftype2) ...@@ -7840,7 +7840,7 @@ compatible_signatures_p (tree ftype1, tree ftype2)
tree tree
substitute_in_type (tree t, tree f, tree r) substitute_in_type (tree t, tree f, tree r)
{ {
tree new; tree new_tree;
gcc_assert (CONTAINS_PLACEHOLDER_P (r)); gcc_assert (CONTAINS_PLACEHOLDER_P (r));
...@@ -7861,15 +7861,15 @@ substitute_in_type (tree t, tree f, tree r) ...@@ -7861,15 +7861,15 @@ substitute_in_type (tree t, tree f, tree r)
if (low == TYPE_GCC_MIN_VALUE (t) && high == TYPE_GCC_MAX_VALUE (t)) if (low == TYPE_GCC_MIN_VALUE (t) && high == TYPE_GCC_MAX_VALUE (t))
return t; return t;
new = copy_type (t); new_tree = copy_type (t);
TYPE_GCC_MIN_VALUE (new) = low; TYPE_GCC_MIN_VALUE (new_tree) = low;
TYPE_GCC_MAX_VALUE (new) = high; TYPE_GCC_MAX_VALUE (new_tree) = high;
if (TREE_CODE (t) == INTEGER_TYPE && TYPE_INDEX_TYPE (t)) if (TREE_CODE (t) == INTEGER_TYPE && TYPE_INDEX_TYPE (t))
SET_TYPE_INDEX_TYPE SET_TYPE_INDEX_TYPE
(new, substitute_in_type (TYPE_INDEX_TYPE (t), f, r)); (new_tree, substitute_in_type (TYPE_INDEX_TYPE (t), f, r));
return new; return new_tree;
} }
/* Then the subtypes. */ /* Then the subtypes. */
...@@ -7882,21 +7882,21 @@ substitute_in_type (tree t, tree f, tree r) ...@@ -7882,21 +7882,21 @@ substitute_in_type (tree t, tree f, tree r)
if (low == TYPE_RM_MIN_VALUE (t) && high == TYPE_RM_MAX_VALUE (t)) if (low == TYPE_RM_MIN_VALUE (t) && high == TYPE_RM_MAX_VALUE (t))
return t; return t;
new = copy_type (t); new_tree = copy_type (t);
SET_TYPE_RM_MIN_VALUE (new, low); SET_TYPE_RM_MIN_VALUE (new_tree, low);
SET_TYPE_RM_MAX_VALUE (new, high); SET_TYPE_RM_MAX_VALUE (new_tree, high);
return new; return new_tree;
} }
return t; return t;
case COMPLEX_TYPE: case COMPLEX_TYPE:
new = substitute_in_type (TREE_TYPE (t), f, r); new_tree = substitute_in_type (TREE_TYPE (t), f, r);
if (new == TREE_TYPE (t)) if (new_tree == TREE_TYPE (t))
return t; return t;
return build_complex_type (new); return build_complex_type (new_tree);
case OFFSET_TYPE: case OFFSET_TYPE:
case METHOD_TYPE: case METHOD_TYPE:
...@@ -7913,16 +7913,16 @@ substitute_in_type (tree t, tree f, tree r) ...@@ -7913,16 +7913,16 @@ substitute_in_type (tree t, tree f, tree r)
if (component == TREE_TYPE (t) && domain == TYPE_DOMAIN (t)) if (component == TREE_TYPE (t) && domain == TYPE_DOMAIN (t))
return t; return t;
new = build_array_type (component, domain); new_tree = build_array_type (component, domain);
TYPE_ALIGN (new) = TYPE_ALIGN (t); TYPE_ALIGN (new_tree) = TYPE_ALIGN (t);
TYPE_USER_ALIGN (new) = TYPE_USER_ALIGN (t); TYPE_USER_ALIGN (new_tree) = TYPE_USER_ALIGN (t);
SET_TYPE_MODE (new, TYPE_MODE (t)); SET_TYPE_MODE (new_tree, TYPE_MODE (t));
TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r); TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r); TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
TYPE_NONALIASED_COMPONENT (new) = TYPE_NONALIASED_COMPONENT (t); TYPE_NONALIASED_COMPONENT (new_tree) = TYPE_NONALIASED_COMPONENT (t);
TYPE_MULTI_ARRAY_P (new) = TYPE_MULTI_ARRAY_P (t); TYPE_MULTI_ARRAY_P (new_tree) = TYPE_MULTI_ARRAY_P (t);
TYPE_CONVENTION_FORTRAN_P (new) = TYPE_CONVENTION_FORTRAN_P (t); TYPE_CONVENTION_FORTRAN_P (new_tree) = TYPE_CONVENTION_FORTRAN_P (t);
return new; return new_tree;
} }
case RECORD_TYPE: case RECORD_TYPE:
...@@ -7935,8 +7935,8 @@ substitute_in_type (tree t, tree f, tree r) ...@@ -7935,8 +7935,8 @@ substitute_in_type (tree t, tree f, tree r)
/* Start out with no fields, make new fields, and chain them /* Start out with no fields, make new fields, and chain them
in. If we haven't actually changed the type of any field, in. If we haven't actually changed the type of any field,
discard everything we've done and return the old type. */ discard everything we've done and return the old type. */
new = copy_type (t); new_tree = copy_type (t);
TYPE_FIELDS (new) = NULL_TREE; TYPE_FIELDS (new_tree) = NULL_TREE;
for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field)) for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
{ {
...@@ -7967,23 +7967,23 @@ substitute_in_type (tree t, tree f, tree r) ...@@ -7967,23 +7967,23 @@ substitute_in_type (tree t, tree f, tree r)
} }
} }
DECL_CONTEXT (new_field) = new; DECL_CONTEXT (new_field) = new_tree;
SET_DECL_ORIGINAL_FIELD (new_field, SET_DECL_ORIGINAL_FIELD (new_field,
(DECL_ORIGINAL_FIELD (field) (DECL_ORIGINAL_FIELD (field)
? DECL_ORIGINAL_FIELD (field) : field)); ? DECL_ORIGINAL_FIELD (field) : field));
TREE_CHAIN (new_field) = TYPE_FIELDS (new); TREE_CHAIN (new_field) = TYPE_FIELDS (new_tree);
TYPE_FIELDS (new) = new_field; TYPE_FIELDS (new_tree) = new_field;
} }
if (!changed_field) if (!changed_field)
return t; return t;
TYPE_FIELDS (new) = nreverse (TYPE_FIELDS (new)); TYPE_FIELDS (new_tree) = nreverse (TYPE_FIELDS (new_tree));
TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r); TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r); TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
SET_TYPE_ADA_SIZE (new, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, r)); SET_TYPE_ADA_SIZE (new_tree, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, r));
return new; return new_tree;
} }
default: default:
......
...@@ -729,10 +729,11 @@ must_pass_by_ref (tree gnu_type) ...@@ -729,10 +729,11 @@ must_pass_by_ref (tree gnu_type)
void void
enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int)) enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int))
{ {
enum machine_mode i; int iloop;
for (i = 0; i < NUM_MACHINE_MODES; i++) for (iloop = 0; iloop < NUM_MACHINE_MODES; iloop++)
{ {
enum machine_mode i = (enum machine_mode) iloop;
enum machine_mode j; enum machine_mode j;
bool float_p = 0; bool float_p = 0;
bool complex_p = 0; bool complex_p = 0;
......
...@@ -100,7 +100,7 @@ bool type_annotate_only; ...@@ -100,7 +100,7 @@ bool type_annotate_only;
/* When not optimizing, we cache the 'First, 'Last and 'Length attributes /* When not optimizing, we cache the 'First, 'Last and 'Length attributes
of unconstrained array IN parameters to avoid emitting a great deal of of unconstrained array IN parameters to avoid emitting a great deal of
redundant instructions to recompute them each time. */ redundant instructions to recompute them each time. */
struct GTY (()) parm_attr { struct GTY (()) parm_attr_d {
int id; /* GTY doesn't like Entity_Id. */ int id; /* GTY doesn't like Entity_Id. */
int dim; int dim;
tree first; tree first;
...@@ -108,7 +108,7 @@ struct GTY (()) parm_attr { ...@@ -108,7 +108,7 @@ struct GTY (()) parm_attr {
tree length; tree length;
}; };
typedef struct parm_attr *parm_attr; typedef struct parm_attr_d *parm_attr;
DEF_VEC_P(parm_attr); DEF_VEC_P(parm_attr);
DEF_VEC_ALLOC_P(parm_attr,gc); DEF_VEC_ALLOC_P(parm_attr,gc);
...@@ -1464,7 +1464,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1464,7 +1464,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
int Dimension = (Present (Expressions (gnat_node)) int Dimension = (Present (Expressions (gnat_node))
? UI_To_Int (Intval (First (Expressions (gnat_node)))) ? UI_To_Int (Intval (First (Expressions (gnat_node))))
: 1), i; : 1), i;
struct parm_attr *pa = NULL; struct parm_attr_d *pa = NULL;
Entity_Id gnat_param = Empty; Entity_Id gnat_param = Empty;
/* Make sure any implicit dereference gets done. */ /* Make sure any implicit dereference gets done. */
...@@ -1508,7 +1508,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1508,7 +1508,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
if (!pa) if (!pa)
{ {
pa = GGC_CNEW (struct parm_attr); pa = GGC_CNEW (struct parm_attr_d);
pa->id = gnat_param; pa->id = gnat_param;
pa->dim = Dimension; pa->dim = Dimension;
VEC_safe_push (parm_attr, gc, f_parm_attr_cache, pa); VEC_safe_push (parm_attr, gc, f_parm_attr_cache, pa);
...@@ -2268,7 +2268,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) ...@@ -2268,7 +2268,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache; cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache;
if (cache) if (cache)
{ {
struct parm_attr *pa; struct parm_attr_d *pa;
int i; int i;
start_stmt_group (); start_stmt_group ();
......
...@@ -1017,33 +1017,33 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special, ...@@ -1017,33 +1017,33 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special,
bool has_rep) bool has_rep)
{ {
tree type = TREE_TYPE (last_size); tree type = TREE_TYPE (last_size);
tree new; tree new_tree;
if (!special || TREE_CODE (size) != COND_EXPR) 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) if (has_rep)
new = size_binop (MAX_EXPR, last_size, new); new_tree = size_binop (MAX_EXPR, last_size, new_tree);
} }
else else
new = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0), new_tree = fold_build3 (COND_EXPR, type, TREE_OPERAND (size, 0),
integer_zerop (TREE_OPERAND (size, 1)) integer_zerop (TREE_OPERAND (size, 1))
? last_size : merge_sizes (last_size, first_bit, ? last_size : merge_sizes (last_size, first_bit,
TREE_OPERAND (size, 1), TREE_OPERAND (size, 1),
1, has_rep), 1, has_rep),
integer_zerop (TREE_OPERAND (size, 2)) integer_zerop (TREE_OPERAND (size, 2))
? last_size : merge_sizes (last_size, first_bit, ? last_size : merge_sizes (last_size, first_bit,
TREE_OPERAND (size, 2), TREE_OPERAND (size, 2),
1, has_rep)); 1, has_rep));
/* We don't need any NON_VALUE_EXPRs and they can confuse us (especially /* 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 when fed through substitute_in_expr) into thinking that a constant
size is not constant. */ size is not constant. */
while (TREE_CODE (new) == NON_LVALUE_EXPR) while (TREE_CODE (new_tree) == NON_LVALUE_EXPR)
new = TREE_OPERAND (new, 0); 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 /* 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, ...@@ -1163,18 +1163,18 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list,
tree tree
copy_type (tree type) 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 /* copy_node clears this field instead of copying it, because it is
aliased with TREE_CHAIN. */ 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_POINTER_TO (new_tree) = 0;
TYPE_REFERENCE_TO (new) = 0; TYPE_REFERENCE_TO (new_tree) = 0;
TYPE_MAIN_VARIANT (new) = new; TYPE_MAIN_VARIANT (new_tree) = new_tree;
TYPE_NEXT_VARIANT (new) = 0; TYPE_NEXT_VARIANT (new_tree) = 0;
return new; return new_tree;
} }
/* Return a subtype of sizetype with range MIN to MAX and whose /* 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) ...@@ -2515,7 +2515,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
tree record_type = make_node (RECORD_TYPE); tree record_type = make_node (RECORD_TYPE);
tree pointer32_type; tree pointer32_type;
tree field_list = 0; tree field_list = 0;
int class; int class_i;
int dtype = 0; int dtype = 0;
tree inner_type; tree inner_type;
int ndim; int ndim;
...@@ -2627,22 +2627,22 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2627,22 +2627,22 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{ {
case By_Descriptor_A: case By_Descriptor_A:
case By_Short_Descriptor_A: case By_Short_Descriptor_A:
class = 4; class_i = 4;
break; break;
case By_Descriptor_NCA: case By_Descriptor_NCA:
case By_Short_Descriptor_NCA: case By_Short_Descriptor_NCA:
class = 10; class_i = 10;
break; break;
case By_Descriptor_SB: case By_Descriptor_SB:
case By_Short_Descriptor_SB: case By_Short_Descriptor_SB:
class = 15; class_i = 15;
break; break;
case By_Descriptor: case By_Descriptor:
case By_Short_Descriptor: case By_Short_Descriptor:
case By_Descriptor_S: case By_Descriptor_S:
case By_Short_Descriptor_S: case By_Short_Descriptor_S:
default: default:
class = 1; class_i = 1;
break; break;
} }
...@@ -2664,7 +2664,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2664,7 +2664,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
field_list = chainon (field_list, field_list = chainon (field_list,
make_descriptor_field ("CLASS", make_descriptor_field ("CLASS",
gnat_type_for_size (8, 1), 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 /* 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. */ 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) ...@@ -2830,7 +2830,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
tree record64_type = make_node (RECORD_TYPE); tree record64_type = make_node (RECORD_TYPE);
tree pointer64_type; tree pointer64_type;
tree field_list64 = 0; tree field_list64 = 0;
int class; int class_i;
int dtype = 0; int dtype = 0;
tree inner_type; tree inner_type;
int ndim; int ndim;
...@@ -2941,18 +2941,18 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2941,18 +2941,18 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
switch (mech) switch (mech)
{ {
case By_Descriptor_A: case By_Descriptor_A:
class = 4; class_i = 4;
break; break;
case By_Descriptor_NCA: case By_Descriptor_NCA:
class = 10; class_i = 10;
break; break;
case By_Descriptor_SB: case By_Descriptor_SB:
class = 15; class_i = 15;
break; break;
case By_Descriptor: case By_Descriptor:
case By_Descriptor_S: case By_Descriptor_S:
default: default:
class = 1; class_i = 1;
break; break;
} }
...@@ -2971,7 +2971,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2971,7 +2971,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
field_list64 = chainon (field_list64, field_list64 = chainon (field_list64,
make_descriptor_field ("CLASS", make_descriptor_field ("CLASS",
gnat_type_for_size (8, 1), gnat_type_for_size (8, 1),
record64_type, size_int (class))); record64_type, size_int (class_i)));
field_list64 = chainon (field_list64, field_list64 = chainon (field_list64,
make_descriptor_field ("MBMO", make_descriptor_field ("MBMO",
...@@ -3154,9 +3154,9 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr); tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */ /* 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. */ /* 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. */ /* Retrieve the value of the POINTER field. */
tree gnu_expr64 tree gnu_expr64
...@@ -3172,9 +3172,9 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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 template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type); tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (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. */ /* 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; tree lfield, ufield;
/* Convert POINTER to the type of the P_ARRAY field. */ /* 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) ...@@ -3185,23 +3185,23 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
case 1: /* Class S */ case 1: /* Class S */
case 15: /* Class SB */ case 15: /* Class SB */
/* Build {1, LENGTH} template; LENGTH64 is the 5th field. */ /* 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 = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
t = tree_cons (min_field, t = tree_cons (min_field,
convert (TREE_TYPE (min_field), integer_one_node), convert (TREE_TYPE (min_field), integer_one_node),
tree_cons (max_field, tree_cons (max_field,
convert (TREE_TYPE (max_field), t), convert (TREE_TYPE (max_field), t),
NULL_TREE)); NULL_TREE));
template = gnat_build_constructor (template_type, t); template_tree = gnat_build_constructor (template_type, t);
template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template); template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
/* For class S, we are done. */ /* For class S, we are done. */
if (iclass == 1) if (iclass == 1)
break; break;
/* Test that we really have a SB descriptor, like DEC Ada. */ /* Test that we really have a SB descriptor, like DEC Ada. */
t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL); t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, NULL);
u = convert (TREE_TYPE (class), DECL_INITIAL (class)); u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u); u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. The fields are 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) ...@@ -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, t = tree_cons (TYPE_FIELDS (template_type), lfield,
tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)), tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
ufield, NULL_TREE)); 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. */ /* Otherwise use the {1, LENGTH} template we build above. */
template_addr = build3 (COND_EXPR, p_bounds_type, u, template_addr = build3 (COND_EXPR, p_bounds_type, u,
build_unary_op (ADDR_EXPR, p_bounds_type, build_unary_op (ADDR_EXPR, p_bounds_type,
template), template_tree),
template_addr); template_addr);
break; break;
...@@ -3266,12 +3266,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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, t = tree_cons (TYPE_FIELDS (template_type), lfield,
tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)), tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
ufield, NULL_TREE)); ufield, NULL_TREE));
template = gnat_build_constructor (template_type, t); template_tree = gnat_build_constructor (template_type, t);
template = build3 (COND_EXPR, p_bounds_type, u, template_tree = build3 (COND_EXPR, p_bounds_type, u,
build_call_raise (CE_Length_Check_Failed, Empty, build_call_raise (CE_Length_Check_Failed, Empty,
N_Raise_Constraint_Error), N_Raise_Constraint_Error),
template); template_tree);
template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template); template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template_tree);
break; break;
case 10: /* Class NCA */ case 10: /* Class NCA */
...@@ -3302,9 +3302,9 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr); tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
/* The CLASS field is the 3rd field in the descriptor. */ /* 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. */ /* 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. */ /* Retrieve the value of the POINTER field. */
tree gnu_expr32 tree gnu_expr32
...@@ -3320,9 +3320,9 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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 template_type = TREE_TYPE (p_bounds_type);
tree min_field = TYPE_FIELDS (template_type); tree min_field = TYPE_FIELDS (template_type);
tree max_field = TREE_CHAIN (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. */ /* 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. */ /* Convert POINTER to the type of the P_ARRAY field. */
gnu_expr32 = convert (p_array_type, gnu_expr32); 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) ...@@ -3339,25 +3339,25 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree_cons (max_field, tree_cons (max_field,
convert (TREE_TYPE (max_field), t), convert (TREE_TYPE (max_field), t),
NULL_TREE)); NULL_TREE));
template = gnat_build_constructor (template_type, t); template_tree = gnat_build_constructor (template_type, t);
template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template); template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template_tree);
/* For class S, we are done. */ /* For class S, we are done. */
if (iclass == 1) if (iclass == 1)
break; break;
/* Test that we really have a SB descriptor, like DEC Ada. */ /* Test that we really have a SB descriptor, like DEC Ada. */
t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL); t = build3 (COMPONENT_REF, TREE_TYPE (class_tree), desc, class_tree, NULL);
u = convert (TREE_TYPE (class), DECL_INITIAL (class)); u = convert (TREE_TYPE (class_tree), DECL_INITIAL (class_tree));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u); u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. */ it is located right after the POINTER field. */
t = TREE_CHAIN (pointer); 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. */ /* Otherwise use the {1, LENGTH} template we build above. */
template_addr = build3 (COND_EXPR, p_bounds_type, u, template_addr = build3 (COND_EXPR, p_bounds_type, u,
build_unary_op (ADDR_EXPR, p_bounds_type, build_unary_op (ADDR_EXPR, p_bounds_type,
template), template_tree),
template_addr); template_addr);
break; break;
...@@ -3384,12 +3384,12 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -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 /* There is already a template in the descriptor and it is
located at the start of block 3 (12th field). */ located at the start of block 3 (12th field). */
t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t)))); t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t))));
template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE); template_tree = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
template = build3 (COND_EXPR, p_bounds_type, u, template_tree = build3 (COND_EXPR, p_bounds_type, u,
build_call_raise (CE_Length_Check_Failed, Empty, build_call_raise (CE_Length_Check_Failed, Empty,
N_Raise_Constraint_Error), N_Raise_Constraint_Error),
template); template_tree);
template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template); template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template_tree);
break; break;
case 10: /* Class NCA */ case 10: /* Class NCA */
...@@ -3720,7 +3720,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -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 template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
tree p_array_type = TREE_TYPE (TYPE_FIELDS (type)); tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
tree etype = TREE_TYPE (expr); tree etype = TREE_TYPE (expr);
tree template; tree template_tree;
/* If EXPR is null, make a fat pointer that contains null pointers to the /* If EXPR is null, make a fat pointer that contains null pointers to the
template and array. */ template and array. */
...@@ -3746,7 +3746,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -3746,7 +3746,7 @@ convert_to_fat_pointer (tree type, tree expr)
else else
expr = build1 (INDIRECT_REF, TREE_TYPE (etype), expr); 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, expr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_component_ref (expr, NULL_TREE, build_component_ref (expr, NULL_TREE,
TREE_CHAIN (fields), false)); TREE_CHAIN (fields), false));
...@@ -3754,7 +3754,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -3754,7 +3754,7 @@ convert_to_fat_pointer (tree type, tree expr)
/* Otherwise, build the constructor for the template. */ /* Otherwise, build the constructor for the template. */
else 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. /* The final result is a constructor for the fat pointer.
...@@ -3774,7 +3774,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -3774,7 +3774,7 @@ convert_to_fat_pointer (tree type, tree expr)
tree_cons (TYPE_FIELDS (type), tree_cons (TYPE_FIELDS (type),
convert (p_array_type, expr), convert (p_array_type, expr),
tree_cons (TREE_CHAIN (TYPE_FIELDS (type)), 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))); NULL_TREE)));
} }
...@@ -4304,20 +4304,20 @@ tree ...@@ -4304,20 +4304,20 @@ tree
maybe_unconstrained_array (tree exp) maybe_unconstrained_array (tree exp)
{ {
enum tree_code code = TREE_CODE (exp); enum tree_code code = TREE_CODE (exp);
tree new; tree new_tree;
switch (TREE_CODE (TREE_TYPE (exp))) switch (TREE_CODE (TREE_TYPE (exp)))
{ {
case UNCONSTRAINED_ARRAY_TYPE: case UNCONSTRAINED_ARRAY_TYPE:
if (code == UNCONSTRAINED_ARRAY_REF) if (code == UNCONSTRAINED_ARRAY_REF)
{ {
new new_tree
= build_unary_op (INDIRECT_REF, NULL_TREE, = build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (exp, 0), build_component_ref (TREE_OPERAND (exp, 0),
get_identifier ("P_ARRAY"), get_identifier ("P_ARRAY"),
NULL_TREE, false)); NULL_TREE, false));
TREE_READONLY (new) = TREE_STATIC (new) = TREE_READONLY (exp); TREE_READONLY (new_tree) = TREE_STATIC (new_tree) = TREE_READONLY (exp);
return new; return new_tree;
} }
else if (code == NULL_EXPR) else if (code == NULL_EXPR)
...@@ -4331,12 +4331,12 @@ maybe_unconstrained_array (tree exp) ...@@ -4331,12 +4331,12 @@ maybe_unconstrained_array (tree exp)
it contains a template. */ it contains a template. */
if (TYPE_IS_PADDING_P (TREE_TYPE (exp))) if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
{ {
new = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp); new_tree = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
if (TREE_CODE (TREE_TYPE (new)) == RECORD_TYPE if (TREE_CODE (TREE_TYPE (new_tree)) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new))) && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new_tree)))
return return
build_component_ref (new, NULL_TREE, build_component_ref (new_tree, NULL_TREE,
TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))), TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new_tree))),
0); 0);
} }
else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp))) else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))
......
...@@ -64,13 +64,13 @@ typedef struct { ...@@ -64,13 +64,13 @@ typedef struct {
static _Unwind_Reason_Code static _Unwind_Reason_Code
trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data) trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data)
{ {
void * pc; char * pc;
#if defined (__ia64__) && defined (__hpux__) #if defined (__ia64__) && defined (__hpux__)
/* Work around problem with _Unwind_GetIP on ia64 HP-UX. */ /* Work around problem with _Unwind_GetIP on ia64 HP-UX. */
uwx_get_reg ((struct uwx_env *) uw_context, UWX_REG_IP, (uint64_t *) &pc); uwx_get_reg ((struct uwx_env *) uw_context, UWX_REG_IP, (uint64_t *) &pc);
#else #else
pc = (void *) _Unwind_GetIP (uw_context); pc = (char *) _Unwind_GetIP (uw_context);
#endif #endif
if (uw_data->n_frames_skipped < uw_data->n_frames_to_skip) if (uw_data->n_frames_skipped < uw_data->n_frames_to_skip)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment