summaryrefslogtreecommitdiff
path: root/gcc/mips-tfile.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-09-07 02:36:41 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-09-07 02:36:41 +0000
commitad85216ece38be37dacbbb3fa7bb7db69aa33a4b (patch)
tree4078f3a9721ec2407abe016bdfff56e653a05da4 /gcc/mips-tfile.c
parentd821b3ac44bd8fe0339c7293046c422109d1910c (diff)
downloadgcc-ad85216ece38be37dacbbb3fa7bb7db69aa33a4b.tar.gz
c-aux-info.c (concat): Don't define.
* c-aux-info.c (concat): Don't define. * cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. From-SVN: r29148
Diffstat (limited to 'gcc/mips-tfile.c')
-rw-r--r--gcc/mips-tfile.c123
1 files changed, 6 insertions, 117 deletions
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 588f4efedc3..649d11fee9c 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -636,7 +636,6 @@ extern void pfatal_with_name
__proto((const char *));
extern void fancy_abort __proto((void));
void botch __proto((const char *));
-extern void xfree __proto((PTR));
extern void fatal PVPROTO((const char *format, ...)) ATTRIBUTE_PRINTF_1;
extern void error PVPROTO((const char *format, ...)) ATTRIBUTE_PRINTF_1;
@@ -1693,7 +1692,6 @@ STATIC void free_thead __proto((thead_t *));
STATIC char *local_index __proto((const char *, int));
STATIC char *local_rindex __proto((const char *, int));
-STATIC const char *my_strsignal __proto((int));
extern char *mktemp __proto((char *));
extern long strtol __proto((const char *, char **, int));
@@ -5022,29 +5020,6 @@ main (argc, argv)
}
-STATIC const char *
-my_strsignal (s)
- int s;
-{
-#ifdef HAVE_STRSIGNAL
- return strsignal (s);
-#else
- if (s >= 0 && s < NSIG)
- {
-# ifdef NO_SYS_SIGLIST
- static char buffer[30];
-
- sprintf (buffer, "Unknown signal %d", s);
- return buffer;
-# else
- return sys_siglist[s];
-# endif
- }
- else
- return NULL;
-#endif /* HAVE_STRSIGNAL */
-}
-
/* Catch a signal and exit without dumping core. */
STATIC void
@@ -5052,7 +5027,7 @@ catch_signal (signum)
int signum;
{
(void) signal (signum, SIG_DFL); /* just in case... */
- fatal (my_strsignal(signum));
+ fatal (strsignal(signum));
}
/* Print a fatal error message. NAME is the text.
@@ -5111,10 +5086,7 @@ STATIC page_t *
allocate_cluster (npages)
Size_t npages;
{
- register page_t *value = (page_t *) calloc (npages, PAGE_USIZE);
-
- if (value == 0)
- fatal ("Virtual memory exhausted.");
+ register page_t *value = (page_t *) xcalloc (npages, PAGE_USIZE);
if (debug > 3)
fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
@@ -5297,7 +5269,7 @@ free_scope (ptr)
alloc_counts[ (int)alloc_type_scope ].free_list.f_scope = ptr;
#else
- xfree ((PTR_T) ptr);
+ free ((PTR_T) ptr);
#endif
}
@@ -5454,7 +5426,7 @@ free_tag (ptr)
alloc_counts[ (int)alloc_type_tag ].free_list.f_tag = ptr;
#else
- xfree ((PTR_T) ptr);
+ free ((PTR_T) ptr);
#endif
}
@@ -5512,7 +5484,7 @@ free_forward (ptr)
alloc_counts[ (int)alloc_type_forward ].free_list.f_forward = ptr;
#else
- xfree ((PTR_T) ptr);
+ free ((PTR_T) ptr);
#endif
}
@@ -5570,7 +5542,7 @@ free_thead (ptr)
alloc_counts[ (int)alloc_type_thead ].free_list.f_thead = ptr;
#else
- xfree ((PTR_T) ptr);
+ free ((PTR_T) ptr);
#endif
}
@@ -5661,89 +5633,6 @@ botch (s)
fatal (s);
}
-/* Same as `malloc' but report error if no memory available. */
-
-PTR
-xmalloc (size)
- size_t size;
-{
- register PTR value = (PTR) malloc (size);
- if (value == 0)
- fatal ("Virtual memory exhausted.");
-
- if (debug > 3)
- {
- fputs ("\tmalloc\tptr = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, value);
- fprintf (stderr, ", size = %10lu\n", (unsigned long) size);
- }
-
- return value;
-}
-
-/* Same as `calloc' but report error if no memory available. */
-
-PTR
-xcalloc (size1, size2)
- size_t size1, size2;
-{
- register PTR value = (PTR) calloc (size1, size2);
- if (value == 0)
- fatal ("Virtual memory exhausted.");
-
- if (debug > 3)
- {
- fputs ("\tcalloc\tptr = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, value);
- fprintf (stderr, ", size1 = %10lu, size2 = %10lu [%lu]\n",
- (unsigned long) size1, (unsigned long) size2,
- (unsigned long) size1*size2);
- }
-
- return value;
-}
-
-/* Same as `realloc' but report error if no memory available. */
-
-PTR
-xrealloc (ptr, size)
- PTR ptr;
- size_t size;
-{
- register PTR result;
- if (ptr)
- result = (PTR) realloc (ptr, size);
- else
- result = (PTR) malloc (size);
- if (!result)
- fatal ("Virtual memory exhausted.");
-
- if (debug > 3)
- {
- fputs ("\trealloc\tptr = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, result);
- fprintf (stderr, ", size = %10lu, orig = ", size);
- fprintf (stderr, HOST_PTR_PRINTF, ptr);
- fputs ("\n", stderr);
- }
-
- return result;
-}
-
-void
-xfree (ptr)
- PTR ptr;
-{
- if (debug > 3)
- {
- fputs ("\tfree\tptr = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, ptr);
- fputs ("\n", stderr);
- }
-
- free (ptr);
-}
-
/* Define our own index/rindex, since the local and global symbol
structures as defined by MIPS has an 'index' field. */