aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.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/except.c
parentd821b3ac44bd8fe0339c7293046c422109d1910c (diff)
downloadgcc-ad85216ece38be37dacbbb3fa7bb7db69aa33a4b.zip
gcc-ad85216ece38be37dacbbb3fa7bb7db69aa33a4b.tar.gz
gcc-ad85216ece38be37dacbbb3fa7bb7db69aa33a4b.tar.bz2
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/except.c')
-rw-r--r--gcc/except.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 0a7b9a9..aa9f19a 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -711,14 +711,14 @@ new_eh_region_entry (note_eh_region, rethrow)
if (num_func_eh_entries == 0)
{
function_eh_regions =
- (struct func_eh_entry *) malloc (SIZE_FUNC_EH (50));
+ (struct func_eh_entry *) xmalloc (SIZE_FUNC_EH (50));
num_func_eh_entries = 50;
}
else
{
num_func_eh_entries = num_func_eh_entries * 3 / 2;
function_eh_regions = (struct func_eh_entry *)
- realloc (function_eh_regions, SIZE_FUNC_EH (num_func_eh_entries));
+ xrealloc (function_eh_regions, SIZE_FUNC_EH (num_func_eh_entries));
}
}
function_eh_regions[current_func_eh_entry].range_number = note_eh_region;
@@ -812,10 +812,7 @@ find_all_handler_type_matches (array)
return 0;
max_ptr = 100;
- ptr = (void **)malloc (max_ptr * sizeof (void *));
-
- if (ptr == NULL)
- return 0;
+ ptr = (void **) xmalloc (max_ptr * sizeof (void *));
for (x = 0 ; x < current_func_eh_entry; x++)
{
@@ -839,9 +836,7 @@ find_all_handler_type_matches (array)
if (n_ptr >= max_ptr)
{
max_ptr += max_ptr / 2;
- ptr = (void **)realloc (ptr, max_ptr * sizeof (void *));
- if (ptr == NULL)
- return 0;
+ ptr = (void **) xrealloc (ptr, max_ptr * sizeof (void *));
}
ptr[n_ptr] = val;
n_ptr++;
@@ -861,7 +856,7 @@ get_new_handler (handler, typeinfo)
void *typeinfo;
{
struct handler_info* ptr;
- ptr = (struct handler_info *) malloc (sizeof (struct handler_info));
+ ptr = (struct handler_info *) xmalloc (sizeof (struct handler_info));
ptr->handler_label = handler;
ptr->handler_number = CODE_LABEL_NUMBER (handler);
ptr->type_info = typeinfo;
@@ -2952,7 +2947,7 @@ init_insn_eh_region (first, max_uid)
max_uid = INSN_UID (insn);
maximum_uid = max_uid;
- insn_eh_region = (int *) malloc ((max_uid + 1) * sizeof (int));
+ insn_eh_region = (int *) xmalloc ((max_uid + 1) * sizeof (int));
insn = first;
set_insn_eh_region (&insn, 0);
}
@@ -3033,7 +3028,7 @@ process_nestinfo (block, info, nested_eh_region)
extra = 0;
info->num_handlers[index] = count + extra;
- info->handlers[index] = (handler_info **) malloc ((count + extra)
+ info->handlers[index] = (handler_info **) xmalloc ((count + extra)
* sizeof (handler_info **));
/* First put all our handlers into the list. */
@@ -3081,9 +3076,8 @@ init_eh_nesting_info ()
rtx insn;
int x;
- info = (eh_nesting_info *) malloc (sizeof (eh_nesting_info));
- info->region_index = (int *) malloc ((max_label_num () + 1) * sizeof (int));
- bzero ((char *) info->region_index, (max_label_num () + 1) * sizeof (int));
+ info = (eh_nesting_info *) xmalloc (sizeof (eh_nesting_info));
+ info->region_index = (int *) xcalloc ((max_label_num () + 1), sizeof (int));
nested_eh_region = (int *) alloca ((max_label_num () + 1) * sizeof (int));
bzero ((char *) nested_eh_region, (max_label_num () + 1) * sizeof (int));
@@ -3122,14 +3116,10 @@ init_eh_nesting_info ()
}
region_count++;
- info->handlers = (handler_info ***) malloc (region_count
- * sizeof (handler_info ***));
- info->num_handlers = (int *) malloc (region_count * sizeof (int));
- info->outer_index = (int *) malloc (region_count * sizeof (int));
-
- bzero ((char *) info->handlers, region_count * sizeof (rtx *));
- bzero ((char *) info->num_handlers, region_count * sizeof (int));
- bzero ((char *) info->outer_index, region_count * sizeof (int));
+ info->handlers = (handler_info ***) xcalloc (region_count,
+ sizeof (handler_info ***));
+ info->num_handlers = (int *) xcalloc (region_count, sizeof (int));
+ info->outer_index = (int *) xcalloc (region_count, sizeof (int));
/* Now initialize the handler lists for all exception blocks. */
for (x = 0; x <= max_label_num (); x++)