gencheck.c, [...]: Don't define xmalloc.
authorZack Weinberg <zack@codesourcery.com>
Sat, 1 Dec 2001 08:16:25 +0000 (08:16 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Sat, 1 Dec 2001 08:16:25 +0000 (08:16 +0000)
* gencheck.c, gengenrtl.c: Don't define xmalloc.
* gensupport.c: Don't define xstrdup, xcalloc, xrealloc,
xmalloc.
* f/fini.c: Use xmalloc.

From-SVN: r47506

gcc/ChangeLog
gcc/f/ChangeLog
gcc/f/fini.c
gcc/gencheck.c
gcc/gengenrtl.c
gcc/gensupport.c

index c6c023721910c3e72bd3cacb967797e1ec658fcf..6af1446ef3112f42b83a336121abcbb2b16233c9 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-01  Zack Weinberg  <zack@codesourcery.com>
+
+       * gencheck.c, gengenrtl.c: Don't define xmalloc.
+       * gensupport.c: Don't define xstrdup, xcalloc, xrealloc,
+       xmalloc.
+
 2001-11-30  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * pa.c (output_ascii): Cast `p' to unsigned char.
index ad2b4aa8b1ff2f83dc0df6c9ac3af9031caca917..969a47655fdb997ecab838c299d7e922bccdceab 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-01  Zack Weinberg  <zack@codesourcery.com>
+
+       * f/fini.c: Use xmalloc.
+
 Fri Nov 30 20:54:02 2001  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Make-lang.in: Delete references to proj.[co], proj-h.[co].
index cfb5ffd23068df5507db5d35076a441d39126650..28d9028df13793ca97e07d6bc62c9b13fa043143 100644 (file)
@@ -367,7 +367,7 @@ main (int argc, char **argv)
 
       /* Make new name object to store name and its keyword. */
 
-      newname = (name) really_call_malloc (sizeof (*newname));
+      newname = (name) xmalloc (sizeof (*newname));
       newname->namelen = strlen (buf);
       newname->kwlen = strlen (kwname);
       total_length = newname->kwlen + fixlengths;
index 87364505d8f4cf7f1eb93d5c0a21e36da6a8707c..c676ef9ecd52936236c57c6c48d888e424c1792d 100644 (file)
@@ -70,24 +70,3 @@ main (argc, argv)
   puts ("\n#endif /* GCC_TREE_CHECK_H */");
   return 0;
 }
-
-#if defined(USE_C_ALLOCA)
-/* FIXME: We only need an xmalloc definition because we are forced to
-   link with alloca.o on some platforms.  This should go away if/when
-   we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
-PTR
-xmalloc (nbytes)
-     size_t nbytes;
-{
-  PTR tmp = (PTR) really_call_malloc (nbytes);
-
-  if (!tmp)
-    {
-      fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
-              nbytes);
-      exit (FATAL_EXIT_CODE);
-    }
-
-  return tmp;
-}
-#endif /* USE_C_ALLOCA */
index ad1bc7fce0639477f84e61c7af15e63ba1df49c9..0d40025f76eeb36e91d9700a1be933d82faaf596 100644 (file)
@@ -390,24 +390,6 @@ gencode ()
     gendef (*fmt);
 }
 
-#if defined(USE_C_ALLOCA)
-PTR
-xmalloc (nbytes)
-  size_t nbytes;
-{
-  PTR tmp = (PTR) really_call_malloc (nbytes);
-
-  if (!tmp)
-    {
-      fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
-              nbytes);
-      exit (FATAL_EXIT_CODE);
-    }
-
-  return tmp;
-}
-#endif /* USE_C_ALLOCA */
-
 /* This is the main program.  We accept only one argument, "-h", which
    says we are writing the genrtl.h file.  Otherwise we are writing the
    genrtl.c file.  */
index 26cf3cb23d2bd277f9c2e4956e7768c1e96e1e00..ae42a41f2b5f70143840855d94e80878dc0bdf26 100644 (file)
@@ -1102,55 +1102,3 @@ read_md_rtx (lineno, seqnr)
 
   return desc;
 }
-
-/* Until we can use the versions in libiberty.  */
-char *
-xstrdup (input)
-  const char *input;
-{
-  size_t len = strlen (input) + 1;
-  char *output = xmalloc (len);
-  memcpy (output, input, len);
-  return output;
-}
-
-PTR
-xcalloc (nelem, elsize)
-  size_t nelem, elsize;
-{
-  PTR newmem;
-
-  if (nelem == 0 || elsize == 0)
-    nelem = elsize = 1;
-
-  newmem = really_call_calloc (nelem, elsize);
-  if (!newmem)
-    fatal ("virtual memory exhausted");
-  return (newmem);
-}
-
-PTR
-xrealloc (old, size)
-  PTR old;
-  size_t size;
-{
-  PTR ptr;
-  if (old)
-    ptr = (PTR) really_call_realloc (old, size);
-  else
-    ptr = (PTR) really_call_malloc (size);
-  if (!ptr)
-    fatal ("virtual memory exhausted");
-  return ptr;
-}
-
-PTR
-xmalloc (size)
-  size_t size;
-{
-  PTR val = (PTR) really_call_malloc (size);
-
-  if (val == 0)
-    fatal ("virtual memory exhausted");
-  return val;
-}