PPC32 backend from the backend praktikum
[libfirm] / ir / be / beirgmod.c
index fc3462a..41c274a 100644 (file)
@@ -4,10 +4,11 @@
 
 #include <stdlib.h>
 
-#ifdef WIN32
-#include <malloc.h>
-#else
-#include <alloca.h>
+#ifdef HAVE_MALLOC_H
+ #include <malloc.h>
+#endif
+#ifdef HAVE_ALLOCA_H
+ #include <alloca.h>
 #endif
 
 #include "hashptr.h"
@@ -108,7 +109,7 @@ static void compute_df(ir_node *n, pmap *df_map)
 
 dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg)
 {
-  dom_front_info_t *info = malloc(sizeof(*info));
+  dom_front_info_t *info = xmalloc(sizeof(*info));
 
   edges_assure(irg);
   info->df_map = pmap_create();
@@ -263,7 +264,7 @@ static ir_node *search_def(ir_node *usage, int pos, pset *copies, pset *copy_blo
                                ir_node **ins = xmalloc(n_preds * sizeof(ins[0]));
 
                                for(i = 0; i < n_preds; ++i)
-                                       ins[i] = new_r_Unknown(irg, mode);
+                                       ins[i] = new_r_Bad(irg);
 
                                phi = new_r_Phi(irg, curr_bl, n_preds, ins, mode);
                                DBG((dbg, LEVEL_2, "\tcreating phi %+F in %+F\n", phi, curr_bl));
@@ -499,7 +500,7 @@ ir_node *insert_Perm_after(const arch_env_t *arch_env,
        if(n == 0)
                return NULL;
 
-       nodes = malloc(n * sizeof(nodes[0]));
+       nodes = xmalloc(n * sizeof(nodes[0]));
 
        DBG((dbg, LEVEL_1, "live:\n"));
        for(irn = pset_first(live), i = 0; irn; irn = pset_next(live), i++) {