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>
* gcc-interface/decl.c (cannot_be_superflat_p): New predicate.
......
......@@ -7840,7 +7840,7 @@ compatible_signatures_p (tree ftype1, tree ftype2)
tree
substitute_in_type (tree t, tree f, tree r)
{
tree new;
tree new_tree;
gcc_assert (CONTAINS_PLACEHOLDER_P (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))
return t;
new = copy_type (t);
TYPE_GCC_MIN_VALUE (new) = low;
TYPE_GCC_MAX_VALUE (new) = high;
new_tree = copy_type (t);
TYPE_GCC_MIN_VALUE (new_tree) = low;
TYPE_GCC_MAX_VALUE (new_tree) = high;
if (TREE_CODE (t) == INTEGER_TYPE && TYPE_INDEX_TYPE (t))
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. */
......@@ -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))
return t;
new = copy_type (t);
SET_TYPE_RM_MIN_VALUE (new, low);
SET_TYPE_RM_MAX_VALUE (new, high);
new_tree = copy_type (t);
SET_TYPE_RM_MIN_VALUE (new_tree, low);
SET_TYPE_RM_MAX_VALUE (new_tree, high);
return new;
return new_tree;
}
return t;
case COMPLEX_TYPE:
new = substitute_in_type (TREE_TYPE (t), f, r);
if (new == TREE_TYPE (t))
new_tree = substitute_in_type (TREE_TYPE (t), f, r);
if (new_tree == TREE_TYPE (t))
return t;
return build_complex_type (new);
return build_complex_type (new_tree);
case OFFSET_TYPE:
case METHOD_TYPE:
......@@ -7913,16 +7913,16 @@ substitute_in_type (tree t, tree f, tree r)
if (component == TREE_TYPE (t) && domain == TYPE_DOMAIN (t))
return t;
new = build_array_type (component, domain);
TYPE_ALIGN (new) = TYPE_ALIGN (t);
TYPE_USER_ALIGN (new) = TYPE_USER_ALIGN (t);
SET_TYPE_MODE (new, TYPE_MODE (t));
TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
TYPE_NONALIASED_COMPONENT (new) = TYPE_NONALIASED_COMPONENT (t);
TYPE_MULTI_ARRAY_P (new) = TYPE_MULTI_ARRAY_P (t);
TYPE_CONVENTION_FORTRAN_P (new) = TYPE_CONVENTION_FORTRAN_P (t);
return new;
new_tree = build_array_type (component, domain);
TYPE_ALIGN (new_tree) = TYPE_ALIGN (t);
TYPE_USER_ALIGN (new_tree) = TYPE_USER_ALIGN (t);
SET_TYPE_MODE (new_tree, TYPE_MODE (t));
TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
TYPE_NONALIASED_COMPONENT (new_tree) = TYPE_NONALIASED_COMPONENT (t);
TYPE_MULTI_ARRAY_P (new_tree) = TYPE_MULTI_ARRAY_P (t);
TYPE_CONVENTION_FORTRAN_P (new_tree) = TYPE_CONVENTION_FORTRAN_P (t);
return new_tree;
}
case RECORD_TYPE:
......@@ -7935,8 +7935,8 @@ substitute_in_type (tree t, tree f, tree r)
/* Start out with no fields, make new fields, and chain them
in. If we haven't actually changed the type of any field,
discard everything we've done and return the old type. */
new = copy_type (t);
TYPE_FIELDS (new) = NULL_TREE;
new_tree = copy_type (t);
TYPE_FIELDS (new_tree) = NULL_TREE;
for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
{
......@@ -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,
(DECL_ORIGINAL_FIELD (field)
? DECL_ORIGINAL_FIELD (field) : field));
TREE_CHAIN (new_field) = TYPE_FIELDS (new);
TYPE_FIELDS (new) = new_field;
TREE_CHAIN (new_field) = TYPE_FIELDS (new_tree);
TYPE_FIELDS (new_tree) = new_field;
}
if (!changed_field)
return t;
TYPE_FIELDS (new) = nreverse (TYPE_FIELDS (new));
TYPE_SIZE (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
SET_TYPE_ADA_SIZE (new, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, r));
return new;
TYPE_FIELDS (new_tree) = nreverse (TYPE_FIELDS (new_tree));
TYPE_SIZE (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
TYPE_SIZE_UNIT (new_tree) = SUBSTITUTE_IN_EXPR (TYPE_SIZE_UNIT (t), f, r);
SET_TYPE_ADA_SIZE (new_tree, SUBSTITUTE_IN_EXPR (TYPE_ADA_SIZE (t), f, r));
return new_tree;
}
default:
......
......@@ -729,10 +729,11 @@ must_pass_by_ref (tree gnu_type)
void
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;
bool float_p = 0;
bool complex_p = 0;
......
......@@ -100,7 +100,7 @@ bool type_annotate_only;
/* When not optimizing, we cache the 'First, 'Last and 'Length attributes
of unconstrained array IN parameters to avoid emitting a great deal of
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 dim;
tree first;
......@@ -108,7 +108,7 @@ struct GTY (()) parm_attr {
tree length;
};
typedef struct parm_attr *parm_attr;
typedef struct parm_attr_d *parm_attr;
DEF_VEC_P(parm_attr);
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)
int Dimension = (Present (Expressions (gnat_node))
? UI_To_Int (Intval (First (Expressions (gnat_node))))
: 1), i;
struct parm_attr *pa = NULL;
struct parm_attr_d *pa = NULL;
Entity_Id gnat_param = Empty;
/* 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)
if (!pa)
{
pa = GGC_CNEW (struct parm_attr);
pa = GGC_CNEW (struct parm_attr_d);
pa->id = gnat_param;
pa->dim = Dimension;
VEC_safe_push (parm_attr, gc, f_parm_attr_cache, pa);
......@@ -2268,7 +2268,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache;
if (cache)
{
struct parm_attr *pa;
struct parm_attr_d *pa;
int i;
start_stmt_group ();
......
......@@ -64,13 +64,13 @@ typedef struct {
static _Unwind_Reason_Code
trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data)
{
void * pc;
char * pc;
#if defined (__ia64__) && defined (__hpux__)
/* Work around problem with _Unwind_GetIP on ia64 HP-UX. */
uwx_get_reg ((struct uwx_env *) uw_context, UWX_REG_IP, (uint64_t *) &pc);
#else
pc = (void *) _Unwind_GetIP (uw_context);
pc = (char *) _Unwind_GetIP (uw_context);
#endif
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