#include "config.h"
#endif
-# include <stdio.h>
+#include <assert.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
+#ifdef HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
# include "st.h"
# include "irgwalk.h"
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");
*/
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);