* decl.c (push_switch): Likewise.
* lex.c (handle_pragma_implementation): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
not ggc_alloc.
(cxx_initialize_diagnostics): Use XNEW, not xmalloc.
* class.c (init_class_processing): Use XNEWVEC, not xmalloc.
* g++spec.c (lang_specific_driver): Likewise.
* mangle.c (save_partially_mangled_name): Likewise.
* parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
(cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
(cp_parser_sizeof_operand): Likewise.
* repo.c (open_repo_file, open_repo_file): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107884
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * decl2.c (get_priority_info): Use XNEW, not xmalloc.
+ * decl.c (push_switch): Likewise.
+ * lex.c (handle_pragma_implementation): Likewise.
+ * cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
+ not ggc_alloc.
+ (cxx_initialize_diagnostics): Use XNEW, not xmalloc.
+ * class.c (init_class_processing): Use XNEWVEC, not xmalloc.
+ * g++spec.c (lang_specific_driver): Likewise.
+ * mangle.c (save_partially_mangled_name): Likewise.
+ * parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
+ (cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
+ (cp_parser_sizeof_operand): Likewise.
+ * repo.c (open_repo_file, open_repo_file): Likewise.
+
2005-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
* parser.c (cp_parser_make_typename_type): Call make_typename_type
current_class_depth = 0;
current_class_stack_size = 10;
current_class_stack
- = xmalloc (current_class_stack_size * sizeof (struct class_stack_node));
+ = XNEWVEC (struct class_stack_node, current_class_stack_size);
local_classes = VEC_alloc (tree, gc, 8);
sizeof_biggest_empty_class = size_zero_node;
cxx_initialize_diagnostics (diagnostic_context *context)
{
pretty_printer *base = context->printer;
- cxx_pretty_printer *pp = xmalloc (sizeof (cxx_pretty_printer));
+ cxx_pretty_printer *pp = XNEW (cxx_pretty_printer);
memcpy (pp_base (pp), base, sizeof (pretty_printer));
pp_cxx_pretty_printer_init (pp);
context->printer = (pretty_printer *) pp;
struct tree_map *h;
void **loc;
- h = ggc_alloc (sizeof (struct tree_map));
+ h = GGC_NEW (struct tree_map);
h->hash = htab_hash_pointer (from);
h->from = from;
h->to = to;
void
push_switch (tree switch_stmt)
{
- struct cp_switch *p = xmalloc (sizeof (struct cp_switch));
+ struct cp_switch *p = XNEW (struct cp_switch);
p->level = current_binding_level;
p->next = switch_stack;
p->switch_stmt = switch_stmt;
{
/* Create a new priority information structure, and insert it
into the map. */
- pi = xmalloc (sizeof (struct priority_info_s));
+ pi = XNEW (struct priority_info_s);
pi->initializations_p = 0;
pi->destructions_p = 0;
splay_tree_insert (priority_info_map,
/* Make sure to have room for the trailing NULL argument. */
num_args = argc + added + need_math + shared_libgcc + (library > 0) + 1;
- arglist = xmalloc (num_args * sizeof (char *));
+ arglist = XNEWVEC (const char *, num_args);
i = 0;
j = 0;
}
if (ifiles == 0)
{
- ifiles = xmalloc (sizeof (struct impl_files));
+ ifiles = XNEW (struct impl_files);
ifiles->filename = filename;
ifiles->next = impl_file_chain;
impl_file_chain = ifiles;
{
gcc_assert (!partially_mangled_name);
partially_mangled_name_len = obstack_object_size (mangle_obstack);
- partially_mangled_name = xmalloc (partially_mangled_name_len);
+ partially_mangled_name = XNEWVEC (char, partially_mangled_name_len);
memcpy (partially_mangled_name, obstack_base (mangle_obstack),
partially_mangled_name_len);
obstack_free (mangle_obstack, obstack_finish (mangle_obstack));
/* Create the buffer. */
alloc = CP_LEXER_BUFFER_SIZE;
- buffer = ggc_alloc (alloc * sizeof (cp_token));
+ buffer = GGC_NEWVEC (cp_token, alloc);
/* Put the first token in the buffer. */
space = alloc;
if (arg_ary == fixed_args)
{
- arg_ary = xmalloc (sizeof (tree) * alloced);
+ arg_ary = XNEWVEC (tree, alloced);
memcpy (arg_ary, fixed_args, sizeof (tree) * n_args);
}
else
saved_message = parser->type_definition_forbidden_message;
/* And create the new one. */
parser->type_definition_forbidden_message
- = xmalloc (strlen (format)
+ = XNEWVEC (const char, strlen (format)
+ strlen (IDENTIFIER_POINTER (ridpointers[keyword]))
+ 1 /* `\0' */);
sprintf ((char *) parser->type_definition_forbidden_message,
if (! p)
p = s + strlen (s);
- repo_name = xmalloc (p - s + 5);
+ repo_name = XNEWVEC (char, p - s + 5);
memcpy (repo_name, s, p - s);
memcpy (repo_name + (p - s), ".rpo", 5);