* tree-vn.c (vn_add): Use XNEW.
* tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
(ccp_fold): Likewise.
(fold_stmt_r): Use explicit cast to convert from void *.
* tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
(new_temp_expr_table): Likewise.
* gimplify.c (lookup_tmp_var): Use XNEW.
(gimplify_asm_expr): Use explcit cast to convert from void *.
* tree-into-ssa.c (get_ssa_name_ann): Likewise.
(get_def_blocks_for): Use XNEW.
(add_to_repl_tbl): Likewise.
(mark_def_sites): Use explicit cast to convert from void *.
(def_blocks_free): Likewise.
(mark_def_sites_initialize_block): Likewise.
(update_ssa): Use XNEWVEC.
* tree-dfa.c (create_var_ann): Use GGC_NEW.
(create_stmt_ann): Likewise.
(create_tree_ann): Likewise.
(referenced_var_insert): Likewise.
(set_default_def): Likewise.
(referenced_var_lookup_if_exists): Use explicit cast to
* convert
from void *.
(referenced_var_lookup): Likewise.
(default_def): Likewise.
(set_default_def): Likewise.
* tree-cfg.c (create_bb): Likewise.
(edge_to_cases_cleanup): Likewise.
(verify_node_sharing): Likewise.
(record_switch_edge): Use XNEW.
(cleanup_dead_labels): Use XCNEWVEC.
(tree_duplicate_sese_region): Use XNEWVEC.
* tree-scalar-evolution.c (get_instantiated_value): Likewise.
* tree-ssa.c (verify_ssa): Use XCNEWVEC.
(int_tree_map_eq): Use explicit cast to convert from void *.
* libgcov.c (gcov_exit): Use explicit cast to convert from
* void *.
(__gcov_execl): Likewise.
(__gcov_execlp): Likewise.
(__gcov_execle): Likewise.
* tree-eh.c (struct_ptr_eq): Likewise.
(struct_ptr_hash): Likewise.
(lookup_stmt_eh_region_fn): Likewise.
(outside_finally_tree): Likewise.
(find_goto_replacement): Likewise.
(make_eh_edge): Likewise.
(mark_eh_edge): Likewise.
(add_stmt_to_eh_region_fn): Use GGC_NEW.
(record_in_finally_tree): Use XNEW.
(maybe_record_in_goto_queue): Use XRESIZEVEC.
(lower_try_finally_copy): Use XCNEWVEC.
From-SVN: r108736
2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * tree-vn.c (vn_add): Use XNEW.
+ * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
+ (ccp_fold): Likewise.
+ (fold_stmt_r): Use explicit cast to convert from void *.
+ * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
+ (new_temp_expr_table): Likewise.
+ * gimplify.c (lookup_tmp_var): Use XNEW.
+ (gimplify_asm_expr): Use explcit cast to convert from void *.
+ * tree-into-ssa.c (get_ssa_name_ann): Likewise.
+ (get_def_blocks_for): Use XNEW.
+ (add_to_repl_tbl): Likewise.
+ (mark_def_sites): Use explicit cast to convert from void *.
+ (def_blocks_free): Likewise.
+ (mark_def_sites_initialize_block): Likewise.
+ (update_ssa): Use XNEWVEC.
+ * tree-dfa.c (create_var_ann): Use GGC_NEW.
+ (create_stmt_ann): Likewise.
+ (create_tree_ann): Likewise.
+ (referenced_var_insert): Likewise.
+ (set_default_def): Likewise.
+ (referenced_var_lookup_if_exists): Use explicit cast to convert
+ from void *.
+ (referenced_var_lookup): Likewise.
+ (default_def): Likewise.
+ (set_default_def): Likewise.
+ * tree-cfg.c (create_bb): Likewise.
+ (edge_to_cases_cleanup): Likewise.
+ (verify_node_sharing): Likewise.
+ (record_switch_edge): Use XNEW.
+ (cleanup_dead_labels): Use XCNEWVEC.
+ (tree_duplicate_sese_region): Use XNEWVEC.
+ * tree-scalar-evolution.c (get_instantiated_value): Likewise.
+ * tree-ssa.c (verify_ssa): Use XCNEWVEC.
+ (int_tree_map_eq): Use explicit cast to convert from void *.
+ * libgcov.c (gcov_exit): Use explicit cast to convert from void *.
+ (__gcov_execl): Likewise.
+ (__gcov_execlp): Likewise.
+ (__gcov_execle): Likewise.
+ * tree-eh.c (struct_ptr_eq): Likewise.
+ (struct_ptr_hash): Likewise.
+ (lookup_stmt_eh_region_fn): Likewise.
+ (outside_finally_tree): Likewise.
+ (find_goto_replacement): Likewise.
+ (make_eh_edge): Likewise.
+ (mark_eh_edge): Likewise.
+ (add_stmt_to_eh_region_fn): Use GGC_NEW.
+ (record_in_finally_tree): Use XNEW.
+ (maybe_record_in_goto_queue): Use XRESIZEVEC.
+ (lower_try_finally_copy): Use XCNEWVEC.
+
+2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* tree-inline.c (copy_body_r): Use explicit cast when converting
from void *.
(copy_bb): Likewise.
slot = htab_find_slot (gimplify_ctxp->temp_htab, (void *)&elt, INSERT);
if (*slot == NULL)
{
- elt_p = xmalloc (sizeof (*elt_p));
+ elt_p = XNEW (elt_t);
elt_p->val = val;
elt_p->temp = ret = create_tmp_from_val (val);
*slot = (void *) elt_p;
break;
}
- str = alloca (len);
+ str = (char *) alloca (len);
for (beg = p + 1, dst = str;;)
{
const char *tem;
prefix_length = 0;
/* Allocate and initialize the filename scratch space. */
- gi_filename = alloca (prefix_length + gcov_max_filename + 1);
+ gi_filename = (char *) alloca (prefix_length + gcov_max_filename + 1);
if (prefix_length)
memcpy (gi_filename, gcov_prefix, prefix_length);
gi_filename_up = gi_filename + prefix_length;
length++;
va_end (ap);
- args = alloca (length * sizeof (void *));
+ args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg;
for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *);
length++;
va_end (ap);
- args = alloca (length * sizeof (void *));
+ args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg;
for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *);
length++;
va_end (ap);
- args = alloca (length * sizeof (void *));
+ args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg;
for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *);
bb->index = last_basic_block;
bb->flags = BB_NEW;
- bb->stmt_list = h ? h : alloc_stmt_list ();
+ bb->stmt_list = h ? (tree) h : alloc_stmt_list ();
/* Add the new block to the linked list of blocks. */
link_block (bb, after);
static void
edge_to_cases_cleanup (void *p)
{
- struct edge_to_cases_elt *elt = p;
+ struct edge_to_cases_elt *elt = (struct edge_to_cases_elt *) p;
tree t, next;
for (t = elt->case_labels; t; t = next)
/* Build a hash table element so we can see if E is already
in the table. */
- elt = xmalloc (sizeof (struct edge_to_cases_elt));
+ elt = XNEW (struct edge_to_cases_elt);
elt->e = e;
elt->case_labels = case_label;
cleanup_dead_labels (void)
{
basic_block bb;
- label_for_bb = xcalloc (last_basic_block, sizeof (tree));
+ label_for_bb = XCNEWVEC (tree, last_basic_block);
/* Find a suitable label for each block. We use the first user-defined
label if there is one, or otherwise just the first label we see. */
slot = htab_find_slot (htab, *tp, INSERT);
if (*slot)
- return *slot;
+ return (tree) *slot;
*slot = *tp;
return NULL;
if (!region_copy)
{
- region_copy = xmalloc (sizeof (basic_block) * n_region);
+ region_copy = XNEWVEC (basic_block, n_region);
free_region_copy = true;
}
/* Record blocks outside the region that are dominated by something
inside. */
- doms = xmalloc (sizeof (basic_block) * n_basic_blocks);
+ doms = XNEWVEC (basic_block, n_basic_blocks);
initialize_original_copy_tables ();
n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms);
gcc_assert (DECL_P (t));
gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
- ann = ggc_alloc (sizeof (*ann));
+ ann = GGC_NEW (struct var_ann_d);
memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = VAR_ANN;
gcc_assert (is_gimple_stmt (t));
gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN);
- ann = ggc_alloc (sizeof (*ann));
+ ann = GGC_NEW (struct stmt_ann_d);
memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = STMT_ANN;
gcc_assert (t);
gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON);
- ann = ggc_alloc (sizeof (*ann));
+ ann = GGC_NEW (union tree_ann_d);
memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = TREE_ANN_COMMON;
{
struct int_tree_map *h, in;
in.uid = uid;
- h = htab_find_with_hash (referenced_vars, &in, uid);
+ h = (struct int_tree_map *) htab_find_with_hash (referenced_vars, &in, uid);
if (h)
return h->to;
return NULL_TREE;
{
struct int_tree_map *h, in;
in.uid = uid;
- h = htab_find_with_hash (referenced_vars, &in, uid);
+ h = (struct int_tree_map *) htab_find_with_hash (referenced_vars, &in, uid);
gcc_assert (h || uid == 0);
if (h)
return h->to;
struct int_tree_map *h;
void **loc;
- h = ggc_alloc (sizeof (struct int_tree_map));
+ h = GGC_NEW (struct int_tree_map);
h->uid = uid;
h->to = to;
loc = htab_find_slot_with_hash (referenced_vars, h, uid, INSERT);
struct int_tree_map *h, in;
gcc_assert (SSA_VAR_P (var));
in.uid = DECL_UID (var);
- h = htab_find_with_hash (default_defs, &in, DECL_UID (var));
+ h = (struct int_tree_map *) htab_find_with_hash (default_defs, &in,
+ DECL_UID (var));
if (h)
return h->to;
return NULL_TREE;
/* Default definition might be changed by tail call optimization. */
if (!*loc)
{
- h = ggc_alloc (sizeof (struct int_tree_map));
+ h = GGC_NEW (struct int_tree_map);
h->uid = DECL_UID (var);
h->to = def;
*(struct int_tree_map **) loc = h;
}
else
{
- h = *loc;
+ h = (struct int_tree_map *) *loc;
h->to = def;
}
}
static int
struct_ptr_eq (const void *a, const void *b)
{
- const void * const * x = a;
- const void * const * y = b;
+ const void * const * x = (const void * const *) a;
+ const void * const * y = (const void * const *) b;
return *x == *y;
}
static hashval_t
struct_ptr_hash (const void *a)
{
- const void * const * x = a;
+ const void * const * x = (const void * const *) a;
return (size_t)*x >> 4;
}
gcc_assert (num >= 0);
gcc_assert (TREE_CODE (t) != RESX_EXPR);
- n = ggc_alloc (sizeof (*n));
+ n = GGC_NEW (struct throw_stmt_node);
n->stmt = t;
n->region_nr = num;
return -2;
n.stmt = t;
- p = htab_find (get_eh_throw_stmt_table (ifun), &n);
+ p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun),
+ &n);
return (p ? p->region_nr : -1);
}
struct finally_tree_node *n;
void **slot;
- n = xmalloc (sizeof (*n));
+ n = XNEW (struct finally_tree_node);
n->child = child;
n->parent = parent;
do
{
n.child = start;
- p = htab_find (finally_tree, &n);
+ p = (struct finally_tree_node *) htab_find (finally_tree, &n);
if (!p)
return true;
start = p->parent;
{
struct goto_queue_node tmp, *ret;
tmp.stmt = stmt;
- ret = bsearch (&tmp, tf->goto_queue, tf->goto_queue_active,
+ ret = (struct goto_queue_node *)
+ bsearch (&tmp, tf->goto_queue, tf->goto_queue_active,
sizeof (struct goto_queue_node), goto_queue_cmp);
return (ret ? ret->repl_stmt : NULL);
}
size = (size ? size * 2 : 32);
tf->goto_queue_size = size;
tf->goto_queue
- = xrealloc (tf->goto_queue, size * sizeof (struct goto_queue_node));
+ = XRESIZEVEC (struct goto_queue_node, tf->goto_queue, size);
}
q = &tf->goto_queue[active];
struct goto_queue_node *q, *qe;
tree return_val = NULL;
int return_index, index;
- struct
+ struct labels_s
{
struct goto_queue_node *q;
tree label;
} *labels;
return_index = VEC_length (tree, tf->dest_array);
- labels = xcalloc (sizeof (*labels), return_index + 1);
+ labels = XCNEWVEC (struct labels_s, return_index + 1);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
tree stmt, lab;
basic_block src, dst;
- stmt = data;
+ stmt = (tree) data;
lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt);
basic_block src, dst;
edge e;
- stmt = data;
+ stmt = (tree) data;
lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt);
if (!SSA_NAME_AUX (name))
SSA_NAME_AUX (name) = xcalloc (1, sizeof (struct ssa_name_info));
- return SSA_NAME_AUX (name);
+ return (struct ssa_name_info *) SSA_NAME_AUX (name);
}
slot = htab_find_slot (def_blocks, (void *) &db, INSERT);
if (*slot == NULL)
{
- db_p = xmalloc (sizeof (*db_p));
+ db_p = XNEW (struct def_blocks_d);
db_p->var = var;
db_p->def_blocks = BITMAP_ALLOC (NULL);
db_p->phi_blocks = BITMAP_ALLOC (NULL);
slot = htab_find_slot (repl_tbl, (void *) &m, INSERT);
if (*slot == NULL)
{
- mp = xmalloc (sizeof (*mp));
+ mp = XNEW (struct repl_map_d);
mp->name = new;
mp->set = BITMAP_ALLOC (NULL);
*slot = (void *) mp;
basic_block bb,
block_stmt_iterator bsi)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
+ struct mark_def_sites_global_data *gd =
+ (struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills;
tree stmt, def;
use_operand_p use_p;
static void
def_blocks_free (void *p)
{
- struct def_blocks_d *entry = p;
+ struct def_blocks_d *entry = (struct def_blocks_d *) p;
BITMAP_FREE (entry->def_blocks);
BITMAP_FREE (entry->phi_blocks);
BITMAP_FREE (entry->livein_blocks);
mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
+ struct mark_def_sites_global_data *gd =
+ (struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills;
bitmap_clear (kills);
}
/* If the caller requested PHI nodes to be added, compute
dominance frontiers. */
- dfs = xmalloc (last_basic_block * sizeof (bitmap));
+ dfs = XNEWVEC (bitmap, last_basic_block);
FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL);
compute_dominance_frontiers (dfs);
{
temp_expr_table_p t;
- t = (temp_expr_table_p) xmalloc (sizeof (struct temp_expr_table_d));
+ t = XNEW (struct temp_expr_table_d);
t->map = map;
- t->version_info = xcalloc (num_ssa_names + 1, sizeof (void *));
- t->partition_dep_list = xcalloc (num_var_partitions (map) + 1,
- sizeof (value_expr_p));
+ t->version_info = XCNEWVEC (void *, num_ssa_names + 1);
+ t->partition_dep_list = XCNEWVEC (value_expr_p,
+ num_var_partitions (map) + 1);
t->replaceable = BITMAP_ALLOC (NULL);
t->partition_in_use = BITMAP_ALLOC (NULL);
struct scev_info_str *info, pattern;
pattern.var = version;
- info = htab_find (cache, &pattern);
+ info = (struct scev_info_str *) htab_find (cache, &pattern);
if (info)
return info->chrec;
{
basic_block bb;
- const_val = xmalloc (num_ssa_names * sizeof (*const_val));
+ const_val = XNEWVEC (prop_value_t, num_ssa_names);
memset (const_val, 0, num_ssa_names * sizeof (*const_val));
/* Initialize simulation flags for PHI nodes and statements. */
use_operand_p var_p;
/* Preserve the original values of every operand. */
- orig = xmalloc (sizeof (tree) * NUM_SSA_OPERANDS (stmt, SSA_OP_USE));
+ orig = XNEWVEC (tree, NUM_SSA_OPERANDS (stmt, SSA_OP_USE));
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
orig[i++] = var;
static tree
fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
{
- struct fold_stmt_r_data *fold_stmt_r_data = data;
+ struct fold_stmt_r_data *fold_stmt_r_data = (struct fold_stmt_r_data *) data;
bool *inside_addr_expr_p = fold_stmt_r_data->inside_addr_expr_p;
bool *changed_p = fold_stmt_r_data->changed_p;
tree expr = *expr_p, t;
{
size_t i;
basic_block bb;
- basic_block *definition_block = xcalloc (num_ssa_names, sizeof (basic_block));
+ basic_block *definition_block = XCNEWVEC (basic_block, num_ssa_names);
ssa_op_iter iter;
tree op;
enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
int
int_tree_map_eq (const void *va, const void *vb)
{
- const struct int_tree_map *a = va, *b = vb;
+ const struct int_tree_map *a = (const struct int_tree_map *) va;
+ const struct int_tree_map *b = (const struct int_tree_map *) vb;
return (a->uid == b->uid);
}
void **slot;
val_expr_pair_t new_pair;
- new_pair = xmalloc (sizeof (struct val_expr_pair_d));
+ new_pair = XNEW (struct val_expr_pair_d);
new_pair->e = expr;
new_pair->v = val;
new_pair->stmt = stmt;