]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl2.c (get_priority_info): Use XNEW, not xmalloc.
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Fri, 2 Dec 2005 11:21:28 +0000 (11:21 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Fri, 2 Dec 2005 11:21:28 +0000 (11:21 +0000)
        * 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.

From-SVN: r107884

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-objcp-common.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/g++spec.c
gcc/cp/lex.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/repo.c

index 209f403bcb8c107d59c72f043370a9646c35ec4a..b0ba117ae1ae6674de1a2338ba46a80aa659422b 100644 (file)
@@ -1,3 +1,19 @@
+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
index 647b7cb67b99c6d8a98b5c071d13831f2b8bddc5..5c1b9e11582c240a4cc5cd0e2f9c6ec610862592 100644 (file)
@@ -5334,7 +5334,7 @@ init_class_processing (void)
   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;
 
index 43a7576bcd42d1175d85046909d7a48d26d7e010..7a4d862336c82a1b03e15cbf1c507376c3fd5184 100644 (file)
@@ -154,7 +154,7 @@ void
 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;
@@ -229,7 +229,7 @@ decl_shadowed_for_var_insert (tree from, tree to)
   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;
index dec134a1fde5d3e6b0bb5dcb0d64e31ad0eb1677..71aac1a1717d5fbb04744e8c028ebf15678b696d 100644 (file)
@@ -2431,7 +2431,7 @@ static struct cp_switch *switch_stack;
 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;
index dcf3217dfb308e9a9f166bf4a0e3847d9adb8723..8c65d946a97206c4f48769c9cb0408ebf4ca52b8 100644 (file)
@@ -2301,7 +2301,7 @@ get_priority_info (int priority)
     {
       /* 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,
index 36cf6c6827fafe3054bc8ab9534601cb3de57a00..ec7cefcb3e6d34a6427b2a09fb2b81ddb4ba20a9 100644 (file)
@@ -252,7 +252,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
 
   /* 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;
index 4ed1077bd3733cb1fed89098085e9f6964a6adb2..469efc83971e5a5d00ae3dd153b74eaac694d251 100644 (file)
@@ -571,7 +571,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
     }
   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;
index b07012252bbafc3a23fd48167cdc08ba14956fea..c654d764bbd33c6126c397f78833d2ed0762300b 100644 (file)
@@ -276,7 +276,7 @@ save_partially_mangled_name (void)
     {
       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));
index e5b43b0d4af781ab5a81c9072cc4fd6fe1deefed..431642255c5a557e595587da904f4853fdb0e9be 100644 (file)
@@ -271,7 +271,7 @@ cp_lexer_new_main (void)
 
   /* 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;
@@ -8930,7 +8930,7 @@ cp_parser_template_argument_list (cp_parser* parser)
 
          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
@@ -15770,7 +15770,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
   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,
index eee3b87f8d3da81d776b0c95598c407d866ff495..d2fae3e0a17ce847879a5a5a7e173cdcac9ea5de 100644 (file)
@@ -132,7 +132,7 @@ open_repo_file (const char *filename)
   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);