summaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 02:36:41 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 02:36:41 +0000
commit713829e97b2cabe9369424002f6efb23a7c86aba (patch)
tree4078f3a9721ec2407abe016bdfff56e653a05da4 /gcc/gcov.c
parentda7052f68ce6c63c9b86c438a016f6052f2e8613 (diff)
downloadgcc-713829e97b2cabe9369424002f6efb23a7c86aba.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r--gcc/gcov.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c
index cdd8c0d229a..7aff8092000 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -267,19 +267,6 @@ fnotice VPROTO ((FILE *file, const char *msgid, ...))
}
-PTR
-xmalloc (size)
- size_t size;
-{
- register PTR value = (PTR) malloc (size);
- if (value == 0)
- {
- fnotice (stderr, "error: virtual memory exhausted");
- exit (FATAL_EXIT_CODE);
- }
- return value;
-}
-
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
@@ -508,10 +495,8 @@ create_program_flow_graph (bptr)
/* Read the number of blocks. */
__read_long (&num_blocks, bbg_file, 4);
- /* Create an array of size bb number of bb_info structs. Bzero it. */
- bb_graph = (struct bb_info *) xmalloc (num_blocks
- * sizeof (struct bb_info));
- bzero ((char *) bb_graph, sizeof (struct bb_info) * num_blocks);
+ /* Create an array of size bb number of bb_info structs. */
+ bb_graph = (struct bb_info *) xcalloc (num_blocks, sizeof (struct bb_info));
bptr->bb_graph = bb_graph;
bptr->num_blocks = num_blocks;
@@ -802,8 +787,7 @@ scan_for_source_files ()
/* No sourcefile structure for this file name exists, create
a new one, and append it to the front of the sources list. */
s_ptr = (struct sourcefile *) xmalloc (sizeof(struct sourcefile));
- s_ptr->name = xmalloc (strlen ((char *) ptr) + 1);
- strcpy (s_ptr->name, (char *) ptr);
+ s_ptr->name = xstrdup (ptr);
s_ptr->maxlineno = 0;
s_ptr->next = sources;
sources = s_ptr;
@@ -1019,17 +1003,11 @@ output_data ()
else
source_file_name = s_ptr->name;
- line_counts = (long *) xmalloc (sizeof (long) * s_ptr->maxlineno);
- bzero ((char *) line_counts, sizeof (long) * s_ptr->maxlineno);
- line_exists = xmalloc (s_ptr->maxlineno);
- bzero (line_exists, s_ptr->maxlineno);
+ line_counts = (long *) xcalloc (sizeof (long), s_ptr->maxlineno);
+ line_exists = xcalloc (1, s_ptr->maxlineno);
if (output_branch_probs)
- {
- branch_probs = (struct arcdata **) xmalloc (sizeof (struct arcdata *)
- * s_ptr->maxlineno);
- bzero ((char *) branch_probs,
- sizeof (struct arcdata *) * s_ptr->maxlineno);
- }
+ branch_probs = (struct arcdata **)
+ xcalloc (sizeof (struct arcdata *), s_ptr->maxlineno);
/* There will be a zero at the beginning of the bb info, before the
first list of line numbers, so must initialize block_num to 0. */