converting
from void *.
(copy_bb): Likewise.
(copy_edges_for_bb): Likewise.
(remap_decl_1): Likewise.
(estimate_num_insns_1): Likewise.
* cgraph.c (hash_node): Use explicit cast when converting from
void *.
(eq_node): Likewise.
(cgraph_create_node): Use GGC_CNEW.
(cgraph_create_edge): Use GGC_NEW.
(cgraph_remove_node): Use explicit cast when converting from
void *.
(hash_varpool_node): Likewise.
(eq_varpool_node): Likewise.
(cgraph_varpool_node): Use GGC_CNEW.
* lambda.h (lambda_vector_new): Use GGC_CNEWVEC.
* tree-scalar-evolution.c (new_scev_info_str): Use XNEW.
(eq_scev_info): Use explicit cast when converting from void *.
(find_var_scev_info): Likewise.
(set_instantiated_value): Likewise.
(gather_stats_on_scev_database_1): Likewise.
* cfgloop.h (simple_loop_desc): Use explicit cast when
converting
from void *.
* c-pch.c (c_common_write_pch): Use XNEWVEC.
(c_common_read_pch): Likewise.
* prefix.c (save_string): Use XNEWVEC.
(translate_name): Use explicit cast when converting from void
*.
* c-ppoutput.c (print_line): Use explicit cast when converting
from void *.
(pp_dir_change): Likewise.
* c-cppbuiltin.c (builtin_define_std): Likewise.
(builtin_define_with_value): Likewise.
(builtin_define_with_value_n): Likewise.
(builtin_define_with_int_value): Likewise.
(builtin_define_type_max): Likewise.
* c-incpath.c (add_env_var_paths): Use XNEWVEC.
(add_path): Use XNEW.
* c-format.c (check_format_info_main): Use GGC_NEW.
(format_type_warning): Use explicit cast when converting from
void *.
* c-typeck.c (alloc_tagged_tu_seen_cache): Use XNEW instead of
xmalloc.
(start_init): Likewise.
* tree-flow-inline.h (first_referenced_var): Use explicit cast
when converting from void *.
(next_referenced_var): Likewise.
* c-pragma.c (push_alignment): Use GGC_NEW instead of
ggc_alloc.
* gensupport.c (lookup_predicate): Use explicit cast to
convert
from void *.
(init_predicate_table): Use XCNEW instead of xcalloc.
* genpreds.c (process_define_predicate): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108723
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+ (copy_edges_for_bb): Likewise.
+ (remap_decl_1): Likewise.
+ (estimate_num_insns_1): Likewise.
+ * cgraph.c (hash_node): Use explicit cast when converting from
+ void *.
+ (eq_node): Likewise.
+ (cgraph_create_node): Use GGC_CNEW.
+ (cgraph_create_edge): Use GGC_NEW.
+ (cgraph_remove_node): Use explicit cast when converting from void *.
+ (hash_varpool_node): Likewise.
+ (eq_varpool_node): Likewise.
+ (cgraph_varpool_node): Use GGC_CNEW.
+ * lambda.h (lambda_vector_new): Use GGC_CNEWVEC.
+ * tree-scalar-evolution.c (new_scev_info_str): Use XNEW.
+ (eq_scev_info): Use explicit cast when converting from void *.
+ (find_var_scev_info): Likewise.
+ (set_instantiated_value): Likewise.
+ (gather_stats_on_scev_database_1): Likewise.
+ * cfgloop.h (simple_loop_desc): Use explicit cast when converting
+ from void *.
+ * c-pch.c (c_common_write_pch): Use XNEWVEC.
+ (c_common_read_pch): Likewise.
+ * prefix.c (save_string): Use XNEWVEC.
+ (translate_name): Use explicit cast when converting from void *.
+ * c-ppoutput.c (print_line): Use explicit cast when converting
+ from void *.
+ (pp_dir_change): Likewise.
+ * c-cppbuiltin.c (builtin_define_std): Likewise.
+ (builtin_define_with_value): Likewise.
+ (builtin_define_with_value_n): Likewise.
+ (builtin_define_with_int_value): Likewise.
+ (builtin_define_type_max): Likewise.
+ * c-incpath.c (add_env_var_paths): Use XNEWVEC.
+ (add_path): Use XNEW.
+ * c-format.c (check_format_info_main): Use GGC_NEW.
+ (format_type_warning): Use explicit cast when converting from void *.
+ * c-typeck.c (alloc_tagged_tu_seen_cache): Use XNEW instead of
+ xmalloc.
+ (start_init): Likewise.
+ * tree-flow-inline.h (first_referenced_var): Use explicit cast
+ when converting from void *.
+ (next_referenced_var): Likewise.
+ * c-pragma.c (push_alignment): Use GGC_NEW instead of ggc_alloc.
+ * gensupport.c (lookup_predicate): Use explicit cast to convert
+ from void *.
+ (init_predicate_table): Use XCNEW instead of xcalloc.
+ * genpreds.c (process_define_predicate): Likewise.
+
2005-12-17 Danny Berlin <dberlin@dberlin.org>
Kenneth Zadeck <zadeck@naturalbridge.com>
builtin_define_std (const char *macro)
{
size_t len = strlen (macro);
- char *buff = alloca (len + 5);
+ char *buff = (char *) alloca (len + 5);
char *p = buff + 2;
char *q = p + len;
if (is_str)
extra += 2; /* space for two quote marks */
- buf = alloca (mlen + elen + extra);
+ buf = (char *) alloca (mlen + elen + extra);
if (is_str)
sprintf (buf, "%s=\"%s\"", macro, expansion);
else
size_t mlen = strlen (macro);
/* Space for an = and a NUL. */
- buf = alloca (mlen + elen + 2);
+ buf = (char *) alloca (mlen + elen + 2);
memcpy (buf, macro, mlen);
buf[mlen] = '=';
memcpy (buf + mlen + 1, expansion, elen);
size_t vlen = 18;
size_t extra = 2; /* space for = and NUL. */
- buf = alloca (mlen + vlen + extra);
+ buf = (char *) alloca (mlen + vlen + extra);
memcpy (buf, macro, mlen);
buf[mlen] = '=';
sprintf (buf + mlen + 1, HOST_WIDE_INT_PRINT_DEC, value);
value = values[idx + TYPE_UNSIGNED (type)];
suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
- buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1);
+ buf = (char *) alloca (strlen (macro) + 1 + strlen (value)
+ + strlen (suffix) + 1);
sprintf (buf, "%s=%s%s", macro, value, suffix);
cpp_define (parse_in, buf);
fci = fci->chain;
if (fci)
{
- wanted_type_ptr = ggc_alloc (sizeof (main_wanted_type));
+ wanted_type_ptr = GGC_NEW (format_wanted_type);
arg_num++;
wanted_type = *fci->types[length_chars_val].type;
wanted_type_name = fci->types[length_chars_val].name;
this is adequate, but formats taking pointers to functions or
arrays would require the full type to be built up in order to
print it with %T. */
- p = alloca (pointer_count + 2);
+ p = (char *) alloca (pointer_count + 2);
if (pointer_count == 0)
p[0] = 0;
else if (c_dialect_cxx ())
path = xstrdup (".");
else
{
- path = xmalloc (q - p + 1);
+ path = XNEWVEC (char, q - p + 1);
memcpy (path, p, q - p);
path[q - p] = '\0';
}
if (*c == '\\') *c = '/';
#endif
- p = xmalloc (sizeof (cpp_dir));
+ p = XNEW (cpp_dir);
p->next = NULL;
p->name = path;
if (chain == SYSTEM || chain == AFTER)
if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1)
fatal_error ("can%'t write %s: %m", pch_file);
- buf = xmalloc (16384);
+ buf = XNEWVEC (char, 16384);
if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
fatal_error ("can%'t seek in %s: %m", asm_file_name);
if (!flag_preprocess_only)
{
unsigned long written;
- char * buf = xmalloc (16384);
+ char * buf = XNEWVEC (char, 16384);
for (written = 0; written < h.asm_size; )
{
const struct line_map *map = linemap_lookup (&line_table, src_loc);
size_t to_file_len = strlen (map->to_file);
- unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1);
+ unsigned char *to_file_quoted =
+ (unsigned char *) alloca (to_file_len * 4 + 1);
unsigned char *p;
print.src_line = SOURCE_LINE (map, src_loc);
pp_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir)
{
size_t to_file_len = strlen (dir);
- unsigned char *to_file_quoted = alloca (to_file_len * 4 + 1);
+ unsigned char *to_file_quoted =
+ (unsigned char *) alloca (to_file_len * 4 + 1);
unsigned char *p;
/* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */
{
align_stack * entry;
- entry = ggc_alloc (sizeof (* entry));
+ entry = GGC_NEW (align_stack);
entry->alignment = alignment;
entry->id = id;
static struct tagged_tu_seen_cache *
alloc_tagged_tu_seen_cache (tree t1, tree t2)
{
- struct tagged_tu_seen_cache *tu = xmalloc (sizeof (struct tagged_tu_seen_cache));
+ struct tagged_tu_seen_cache *tu = XNEW (struct tagged_tu_seen_cache);
tu->next = tagged_tu_seen_base;
tu->t1 = t1;
tu->t2 = t2;
start_init (tree decl, tree asmspec_tree ATTRIBUTE_UNUSED, int top_level)
{
const char *locus;
- struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
+ struct initializer_stack *p = XNEW (struct initializer_stack);
p->decl = constructor_decl;
p->require_constant_value = require_constant_value;
static inline struct niter_desc *
simple_loop_desc (struct loop *loop)
{
- return loop->aux;
+ return (struct niter_desc *) loop->aux;
}
/* The properties of the target. */
static hashval_t
hash_node (const void *p)
{
- const struct cgraph_node *n = p;
+ const struct cgraph_node *n = (const struct cgraph_node *) p;
return (hashval_t) DECL_UID (n->decl);
}
static int
eq_node (const void *p1, const void *p2)
{
- const struct cgraph_node *n1 = p1, *n2 = p2;
+ const struct cgraph_node *n1 = (const struct cgraph_node *) p1;
+ const struct cgraph_node *n2 = (const struct cgraph_node *) p2;
return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
{
struct cgraph_node *node;
- node = ggc_alloc_cleared (sizeof (*node));
+ node = GGC_CNEW (struct cgraph_node);
node->next = cgraph_nodes;
node->uid = cgraph_max_uid++;
if (cgraph_nodes)
cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
tree call_stmt, gcov_type count, int nest)
{
- struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
+ struct cgraph_edge *edge = GGC_NEW (struct cgraph_edge);
#ifdef ENABLE_CHECKING
struct cgraph_edge *e;
*/
if (!kill_body && *slot)
{
- struct cgraph_node *n = *slot;
+ struct cgraph_node *n = (struct cgraph_node *) *slot;
if (!n->next_clone && !n->global.inlined_to
&& (cgraph_global_info_ready
&& (TREE_ASM_WRITTEN (n->decl) || DECL_EXTERNAL (n->decl))))
static hashval_t
hash_varpool_node (const void *p)
{
- const struct cgraph_varpool_node *n = p;
+ const struct cgraph_varpool_node *n = (const struct cgraph_varpool_node *) p;
return (hashval_t) DECL_UID (n->decl);
}
static int
eq_varpool_node (const void *p1, const void *p2)
{
- const struct cgraph_varpool_node *n1 = p1, *n2 = p2;
+ const struct cgraph_varpool_node *n1 =
+ (const struct cgraph_varpool_node *) p1;
+ const struct cgraph_varpool_node *n2 =
+ (const struct cgraph_varpool_node *) p2;
return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
htab_find_slot (cgraph_varpool_hash, &key, INSERT);
if (*slot)
return *slot;
- node = ggc_alloc_cleared (sizeof (*node));
+ node = GGC_CNEW (struct cgraph_varpool_node);
node->decl = decl;
node->next = cgraph_varpool_nodes;
cgraph_varpool_nodes = node;
return;
}
- pred = xcalloc (sizeof (struct pred_data), 1);
+ pred = XCNEW (struct pred_data);
pred->name = XSTR (defn, 0);
pred->exp = XEXP (defn, 1);
pred->c_block = XSTR (defn, 2);
{
struct pred_data key;
key.name = name;
- return htab_find (predicate_table, &key);
+ return (struct pred_data *) htab_find (predicate_table, &key);
}
void
for (i = 0; i < NUM_KNOWN_STD_PREDS; i++)
{
- pred = xcalloc (sizeof (struct pred_data), 1);
+ pred = XCNEW (struct pred_data);
pred->name = std_preds[i].name;
pred->special = std_preds[i].special;
static inline lambda_vector
lambda_vector_new (int size)
{
- return ggc_alloc_cleared (size * sizeof(int));
+ return GGC_CNEWVEC (int, size);
}
static char *
save_string (const char *s, int len)
{
- char *result = xmalloc (len + 1);
+ char *result = XNEWVEC (char, len + 1);
memcpy (result, s, len);
result[len] = 0;
keylen++)
;
- key = alloca (keylen + 1);
+ key = (char *) alloca (keylen + 1);
strncpy (key, &name[1], keylen);
key[keylen] = 0;
first_referenced_var (referenced_var_iterator *iter)
{
struct int_tree_map *itm;
- itm = first_htab_element (&iter->hti, referenced_vars);
+ itm = (struct int_tree_map *) first_htab_element (&iter->hti,
+ referenced_vars);
if (!itm)
return NULL;
return itm->to;
next_referenced_var (referenced_var_iterator *iter)
{
struct int_tree_map *itm;
- itm = next_htab_element (&iter->hti);
+ itm = (struct int_tree_map *) next_htab_element (&iter->hti);
if (!itm)
return NULL;
return itm->to;
else /* Else the RETURN_EXPR returns no value. */
{
*tp = NULL;
- return (void *)1;
+ return (tree) (void *)1;
}
}
/* create_basic_block() will append every new block to
basic_block_info automatically. */
- copy_basic_block = create_basic_block (NULL, (void *) 0, bb->prev_bb->aux);
+ copy_basic_block = create_basic_block (NULL, (void *) 0,
+ (basic_block) bb->prev_bb->aux);
copy_basic_block->count = bb->count * count_scale / REG_BR_PROB_BASE;
copy_basic_block->frequency = (bb->frequency
* frequency_scale / REG_BR_PROB_BASE);
static void
copy_edges_for_bb (basic_block bb, int count_scale)
{
- basic_block new_bb = bb->aux;
+ basic_block new_bb = (basic_block) bb->aux;
edge_iterator ei;
edge old_edge;
block_stmt_iterator bsi;
if (old_edge->dest->index == EXIT_BLOCK && !old_edge->flags
&& old_edge->dest->aux != EXIT_BLOCK_PTR)
flags |= EDGE_FALLTHRU;
- new = make_edge (new_bb, old_edge->dest->aux, flags);
+ new = make_edge (new_bb, (basic_block) old_edge->dest->aux, flags);
new->count = old_edge->count * count_scale / REG_BR_PROB_BASE;
new->probability = old_edge->probability;
}
static tree
remap_decl_1 (tree decl, void *data)
{
- return remap_decl (decl, data);
+ return remap_decl (decl, (inline_data *) data);
}
/* Make a copy of the body of FN so that it can be inserted inline in
static tree
estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
{
- int *count = data;
+ int *count = (int *) data;
tree x = *tp;
if (IS_TYPE_OR_DECL_P (x))
{
struct scev_info_str *res;
- res = xmalloc (sizeof (struct scev_info_str));
+ res = XNEW (struct scev_info_str);
res->var = var;
res->chrec = chrec_not_analyzed_yet;
static int
eq_scev_info (const void *e1, const void *e2)
{
- const struct scev_info_str *elt1 = e1;
- const struct scev_info_str *elt2 = e2;
+ const struct scev_info_str *elt1 = (const struct scev_info_str *) e1;
+ const struct scev_info_str *elt2 = (const struct scev_info_str *) e2;
return elt1->var == elt2->var;
}
if (!*slot)
*slot = new_scev_info_str (var);
- res = *slot;
+ res = (struct scev_info_str *) *slot;
return &res->chrec;
}
pattern.var = version;
slot = htab_find_slot (cache, &pattern, INSERT);
- if (*slot)
- info = *slot;
- else
- info = *slot = new_scev_info_str (version);
+ if (!*slot)
+ *slot = new_scev_info_str (version);
+ info = (struct scev_info_str *) *slot;
info->chrec = val;
}
static int
gather_stats_on_scev_database_1 (void **slot, void *stats)
{
- struct scev_info_str *entry = *slot;
+ struct scev_info_str *entry = (struct scev_info_str *) *slot;
- gather_chrec_stats (entry->chrec, stats);
+ gather_chrec_stats (entry->chrec, (struct chrec_stats *) stats);
return 1;
}