This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

more junk goes away...


now we have build libiberty, gen* don't need their own copies of
xmalloc.

bootstrapped i386-linux.

zw

	* gencheck.c, gengenrtl.c: don't define xmalloc.
	* gensupport.c: don't define xstrdup, xcalloc, xrealloc,
	xmalloc.
	* f/fini.c: use xmalloc.

===================================================================
Index: gencheck.c
--- gencheck.c	2001/10/11 03:15:42	1.21
+++ gencheck.c	2001/11/30 05:09:48
@@ -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: gengenrtl.c
--- gengenrtl.c	2001/11/03 16:28:33	1.48
+++ gengenrtl.c	2001/11/30 05:09:49
@@ -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: gensupport.c
--- gensupport.c	2001/11/16 22:59:46	1.26
+++ gensupport.c	2001/11/30 05:09:49
@@ -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;
-}
===================================================================
Index: f/fini.c
--- f/fini.c	2001/09/12 16:52:41	1.17
+++ f/fini.c	2001/11/30 05:09:49
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]