X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fst%2Fst.c;h=e51d5a71887520f7eae4b6ff20f811e88fb440ac;hb=911b30675bfe85e26cc1021d539323334bfd0db1;hp=b4ab098a40d5f7feb76dfbf23b0bb4f339ed8768;hpb=dddcc630819f338c3b45e2bc646233e6872d5bb6;p=libfirm diff --git a/ir/st/st.c b/ir/st/st.c index b4ab098a4..e51d5a718 100644 --- a/ir/st/st.c +++ b/ir/st/st.c @@ -23,8 +23,20 @@ #include "config.h" #endif +#include + +#ifdef HAVE_STDIO_H # include +#endif +#ifdef HAVE_STDLIB_H # include +#endif +#ifdef HAVE_MALLOC_H +# include +#endif +#ifdef HAVE_ALLOCA_H +# include +#endif # include "st.h" # include "irgwalk.h" @@ -113,9 +125,9 @@ static dt_t *new_dt (ir_graph *graph) res->n_blocks = n_blocks; res->graph = graph; - res->blocks = (ir_node**) calloc (n_blocks, sizeof (ir_node*)); - res->idoms = (ir_node**) calloc (n_blocks, sizeof (ir_node*)); - res->masks = (bs_t*) calloc (n_blocks, sizeof (bs_t)); + 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"); @@ -432,7 +444,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 = (dom_env_t*) calloc (1, sizeof (dom_env_t)); + dom_env_t *env = xcalloc(1, sizeof(*env)); env->graph = graph; env->dt = get_dominator_tree (graph);