* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
* typeck2.c (abstract_virtuals_error): Use GGC_NEW.
* name-lookup.c (binding_entry_make): Use GGC_NEW.
(binding_table_construct): Use GGC_CNEWVEC.
(binding_table_new): Use GGC_NEW.
(cxx_binding_make): Likewise.
(begin_scope): Likewise.
(push_to_top_level): Use GCC_CNEW.
* parser.c (cp_token_cache_new): Likewise.
(cp_token_cache_push_token): Likewise.
(cp_lexer_new_main): Likewise.
(cp_lexer_new_from_tokens): Likewise.
(cp_parser_context_new): Likewise.
(cp_parser_new): Likewise.
(cp_lexer_new_from_tokens): Use GGC_NEWVEC.
* lex.c (cxx_make_type): Use GGC_CNEW.
(retrofit_lang_decl): Use GGC_NEWVAR.
(cxx_dup_lang_specific_decl): Likewise.
(copy_lang_type): Likewise.
* decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
(save_function_data): Likewise.
(lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
(cxx_push_function_context): Likewise.
From-SVN: r85150
+2004-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
+ * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
+ * name-lookup.c (binding_entry_make): Use GGC_NEW.
+ (binding_table_construct): Use GGC_CNEWVEC.
+ (binding_table_new): Use GGC_NEW.
+ (cxx_binding_make): Likewise.
+ (begin_scope): Likewise.
+ (push_to_top_level): Use GCC_CNEW.
+ * parser.c (cp_token_cache_new): Likewise.
+ (cp_token_cache_push_token): Likewise.
+ (cp_lexer_new_main): Likewise.
+ (cp_lexer_new_from_tokens): Likewise.
+ (cp_parser_context_new): Likewise.
+ (cp_parser_new): Likewise.
+ (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
+ * lex.c (cxx_make_type): Use GGC_CNEW.
+ (retrofit_lang_decl): Use GGC_NEWVAR.
+ (cxx_dup_lang_specific_decl): Likewise.
+ (copy_lang_type): Likewise.
+ * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
+ (save_function_data): Likewise.
+ (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
+ (cxx_push_function_context): Likewise.
+
2004-07-25 Richard Henderson <rth@redhat.com>
* decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
n_fields = count_fields (TYPE_FIELDS (t));
if (n_fields > 7)
{
- struct sorted_fields_type *field_vec = ggc_alloc (sizeof (struct sorted_fields_type)
- + n_fields * sizeof (tree));
+ struct sorted_fields_type *field_vec = GGC_NEWVAR
+ (struct sorted_fields_type,
+ sizeof (struct sorted_fields_type) + n_fields * sizeof (tree));
field_vec->len = n_fields;
add_fields_to_record_type (TYPE_FIELDS (t), field_vec, 0);
qsort (field_vec->elts, n_fields, sizeof (tree),
do { \
if (TYPE_LANG_SPECIFIC (NODE) == NULL) \
{ \
- TYPE_LANG_SPECIFIC (NODE) = \
- ggc_alloc_cleared (sizeof (struct lang_type_ptrmem)); \
+ TYPE_LANG_SPECIFIC (NODE) = GGC_CNEWVAR \
+ (struct lang_type, sizeof (struct lang_type_ptrmem)); \
TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.h.is_lang_type_class = 0; \
} \
TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.record = (VALUE); \
|| named_label_uses->label_decl != decl)
{
struct named_label_use_list *new_ent;
- new_ent = ggc_alloc (sizeof (struct named_label_use_list));
+ new_ent = GGC_NEW (struct named_label_use_list);
new_ent->label_decl = decl;
new_ent->names_in_scope = current_binding_level->names;
new_ent->binding_level = current_binding_level;
/* Record this label on the list of labels used in this function.
We do this before calling make_label_decl so that we get the
IDENTIFIER_LABEL_VALUE before the new label is declared. */
- ent = ggc_alloc_cleared (sizeof (struct named_label_list));
+ ent = GGC_CNEW (struct named_label_list);
ent->old_value = IDENTIFIER_LABEL_VALUE (id);
ent->next = named_labels;
named_labels = ent;
19990908);
/* Make a copy. */
- f = ggc_alloc (sizeof (struct language_function));
+ f = GGC_NEW (struct language_function);
memcpy (f, cp_function_chain, sizeof (struct language_function));
DECL_SAVED_FUNCTION_DATA (decl) = f;
void
cxx_push_function_context (struct function * f)
{
- struct language_function *p
- = ggc_alloc_cleared (sizeof (struct language_function));
+ struct language_function *p = GGC_CNEW (struct language_function);
f->language = p;
/* Whenever we start a new function, we destroy temporaries in the
else
size = sizeof (struct lang_decl_flags);
- ld = ggc_alloc_cleared (size);
+ ld = GGC_CNEWVAR (struct lang_decl, size);
ld->decl_flags.can_be_full = CAN_HAVE_FULL_LANG_DECL_P (t) ? 1 : 0;
ld->decl_flags.u1sel = TREE_CODE (t) == NAMESPACE_DECL ? 1 : 0;
size = sizeof (struct lang_decl_flags);
else
size = sizeof (struct lang_decl);
- ld = ggc_alloc (size);
+ ld = GGC_NEWVAR (struct lang_decl, size);
memcpy (ld, DECL_LANG_SPECIFIC (node), size);
DECL_LANG_SPECIFIC (node) = ld;
size = sizeof (struct lang_type);
else
size = sizeof (struct lang_type_ptrmem);
- lt = ggc_alloc (size);
+ lt = GGC_NEWVAR (struct lang_type, size);
memcpy (lt, TYPE_LANG_SPECIFIC (node), size);
TYPE_LANG_SPECIFIC (node) = lt;
if (IS_AGGR_TYPE_CODE (code)
|| code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
- struct lang_type *pi;
-
- pi = ggc_alloc_cleared (sizeof (struct lang_type));
+ struct lang_type *pi = GGC_CNEW (struct lang_type);
TYPE_LANG_SPECIFIC (t) = pi;
pi->u.c.h.is_lang_type_class = 1;
free_binding_entry = entry->chain;
}
else
- entry = ggc_alloc (sizeof (struct binding_entry_s));
+ entry = GGC_NEW (struct binding_entry_s);
entry->name = name;
entry->type = type;
{
table->chain_count = chain_count;
table->entry_count = 0;
- table->chain = ggc_alloc_cleared
- (table->chain_count * sizeof (binding_entry));
+ table->chain = GGC_CNEWVEC (binding_entry, table->chain_count);
}
/* Make TABLE's entries ready for reuse. */
static inline binding_table
binding_table_new (size_t chain_count)
{
- binding_table table = ggc_alloc (sizeof (struct binding_table_s));
+ binding_table table = GGC_NEW (struct binding_table_s);
table->chain = NULL;
binding_table_construct (table, chain_count);
return table;
free_bindings = binding->previous;
}
else
- binding = ggc_alloc (sizeof (cxx_binding));
+ binding = GGC_NEW (cxx_binding);
cxx_binding_init (binding, value, type);
free_binding_level = scope->level_chain;
}
else
- scope = ggc_alloc (sizeof (cxx_scope));
+ scope = GGC_NEW (cxx_scope);
memset (scope, 0, sizeof (cxx_scope));
scope->this_entity = entity;
int need_pop;
timevar_push (TV_NAME_LOOKUP);
- s = ggc_alloc_cleared (sizeof (struct saved_scope));
+ s = GGC_CNEW (struct saved_scope);
b = scope_chain ? current_binding_level : 0;
static cp_token_cache *
cp_token_cache_new (void)
{
- return ggc_alloc_cleared (sizeof (cp_token_cache));
+ return GGC_CNEW (cp_token_cache);
}
/* Add *TOKEN to *CACHE. */
/* See if we need to allocate a new token block. */
if (!b || b->num_tokens == CP_TOKEN_BLOCK_NUM_TOKENS)
{
- b = ggc_alloc_cleared (sizeof (cp_token_block));
+ b = GGC_CNEW (cp_token_block);
b->prev = cache->last;
if (cache->last)
{
c_common_no_more_pch ();
/* Allocate the memory. */
- lexer = ggc_alloc_cleared (sizeof (cp_lexer));
+ lexer = GGC_CNEW (cp_lexer);
/* Create the circular buffer. */
lexer->buffer = ggc_calloc (CP_TOKEN_BUFFER_SIZE, sizeof (cp_token));
ptrdiff_t num_tokens;
/* Allocate the memory. */
- lexer = ggc_alloc_cleared (sizeof (cp_lexer));
+ lexer = GGC_CNEW (cp_lexer);
/* Create a new buffer, appropriately sized. */
num_tokens = 0;
for (block = tokens->first; block != NULL; block = block->next)
num_tokens += block->num_tokens;
- lexer->buffer = ggc_alloc (num_tokens * sizeof (cp_token));
+ lexer->buffer = GGC_NEWVEC (cp_token, num_tokens);
lexer->buffer_end = lexer->buffer + num_tokens;
/* Install the tokens. */
memset (context, 0, sizeof (*context));
}
else
- context = ggc_alloc_cleared (sizeof (cp_parser_context));
+ context = GGC_CNEW (cp_parser_context);
/* No errors have occurred yet in this context. */
context->status = CP_PARSER_STATUS_KIND_NO_ERROR;
/* If this is not the bottomost context, copy information that we
cp_lexer_new_main might load a PCH file. */
lexer = cp_lexer_new_main ();
- parser = ggc_alloc_cleared (sizeof (cp_parser));
+ parser = GGC_CNEW (cp_parser);
parser->lexer = lexer;
parser->context = cp_parser_context_new (NULL);
slot = htab_find_slot_with_hash (abstract_pending_vars, type,
(hashval_t)TYPE_UID (type), INSERT);
- pat = ggc_alloc (sizeof (struct pending_abstract_type));
+ pat = GGC_NEW (struct pending_abstract_type);
pat->type = type;
pat->decl = decl;
pat->locus = ((decl && DECL_P (decl))