diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/f/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/f/fini.c | 2 | ||||
-rw-r--r-- | gcc/gencheck.c | 21 | ||||
-rw-r--r-- | gcc/gengenrtl.c | 18 | ||||
-rw-r--r-- | gcc/gensupport.c | 52 |
6 files changed, 11 insertions, 92 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6c02372191..6af1446ef31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index ad2b4aa8b1f..969a47655fd 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -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]. diff --git a/gcc/f/fini.c b/gcc/f/fini.c index cfb5ffd2306..28d9028df13 100644 --- a/gcc/f/fini.c +++ b/gcc/f/fini.c @@ -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; diff --git a/gcc/gencheck.c b/gcc/gencheck.c index 87364505d8f..c676ef9ecd5 100644 --- a/gcc/gencheck.c +++ b/gcc/gencheck.c @@ -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 */ diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index ad1bc7fce06..0d40025f76e 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -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. */ diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 26cf3cb23d2..ae42a41f2b5 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -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; -} |