From bbcf808fc4c4da0acd43eb3b8d27793bac9c0b6f Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 23 Dec 2004 15:16:12 +0000 Subject: [PATCH] used xcalloc instead of calloc [r4747] --- ir/ana/callgraph.c | 4 ++-- ir/st/st.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ir/ana/callgraph.c b/ir/ana/callgraph.c index 1520d34ae..e7594ac7d 100644 --- a/ir/ana/callgraph.c +++ b/ir/ana/callgraph.c @@ -221,7 +221,7 @@ void compute_callgraph(void) { callee_set = (pset *)irg->callees; count = pset_count(callee_set); irg->callees = NEW_ARR_F(ir_graph *, count); - irg->callee_isbe = calloc(count, sizeof(*irg->callee_isbe)); + irg->callee_isbe = xcalloc(count, sizeof(irg->callee_isbe[0])); c = pset_first(callee_set); for (j = 0; j < count; ++j) { irg->callees[j] = c; @@ -233,7 +233,7 @@ void compute_callgraph(void) { caller_set = (pset *)irg->callers; count = pset_count(caller_set); irg->callers = NEW_ARR_F(ir_graph *, count); - irg->caller_isbe = calloc(count, sizeof(*irg->caller_isbe)); + irg->caller_isbe = xcalloc(count, sizeof(irg->caller_isbe[0])); c = pset_first(caller_set); for (j = 0; j < count; ++j) { irg->callers[j] = c; diff --git a/ir/st/st.c b/ir/st/st.c index e1204c310..3b3e84cce 100644 --- a/ir/st/st.c +++ b/ir/st/st.c @@ -119,9 +119,9 @@ static dt_t *new_dt (ir_graph *graph) res->n_blocks = n_blocks; res->graph = graph; - res->blocks = calloc(n_blocks, sizeof(*res->blocks)); - res->idoms = calloc(n_blocks, sizeof(*res->idoms)); - res->masks = calloc(n_blocks, sizeof(*res->masks)); + res->blocks = xcalloc(n_blocks, sizeof(res->blocks[0])); + res->idoms = xcalloc(n_blocks, sizeof(res->idoms[0])); + res->masks = xcalloc(n_blocks, sizeof(res->masks[0])); assert (res && "no dt"); @@ -438,7 +438,7 @@ ir_node *get_idom (ir_graph *g, ir_node *a) */ dom_env_t *get_dom_env (ir_graph *graph, ir_node *a) { - dom_env_t *env = calloc(1, sizeof(*env)); + dom_env_t *env = xcalloc(1, sizeof(*env)); env->graph = graph; env->dt = get_dominator_tree (graph); -- 2.20.1