Dump calling conventions for entities
[libfirm] / ir / ir / ircons.c
index 77aa5c4..e0b2c97 100644 (file)
@@ -55,7 +55,7 @@ typedef struct Phi_in_stack Phi_in_stack;
 # define IRN_VRFY_IRG(res, irg)
 #else
 # define IRN_VRFY_IRG(res, irg)  irn_vrfy_irg(res, irg)
-#endif
+#endif /* NDEBUG */
 
 /**
  * Language dependent variable initialization callback.
@@ -296,6 +296,7 @@ new_bd_Sub (dbg_info *db, ir_node *block,
   res = new_ir_node (db, irg, block, op_Sub, mode, 2, in);
   res = optimize_node (res);
   IRN_VRFY_IRG(res, irg);
+
   return res;
 }
 
@@ -587,6 +588,7 @@ new_bd_Cond (dbg_info *db, ir_node *block, ir_node *c)
   res = new_ir_node (db, irg, block, op_Cond, mode_T, 1, &c);
   res->attr.c.kind         = dense;
   res->attr.c.default_proj = 0;
+  res->attr.c.pred         = COND_JMP_PRED_NONE;
   res = optimize_node (res);
   IRN_VRFY_IRG(res, irg);
   return res;
@@ -941,6 +943,27 @@ new_bd_Mux  (dbg_info *db, ir_node *block,
   return res;
 }
 
+static ir_node *
+new_bd_CopyB  (dbg_info *db, ir_node *block,
+    ir_node *store, ir_node *dst, ir_node *src, type *data_type)
+{
+  ir_node  *in[3];
+  ir_node  *res;
+  ir_graph *irg = current_ir_graph;
+
+  in[0] = store;
+  in[1] = dst;
+  in[2] = src;
+
+  res = new_ir_node(db, irg, block, op_CopyB, mode_T, 3, in);
+
+  res->attr.copyb.exc.pin_state = op_pin_state_pinned;
+  res->attr.copyb.data_type     = data_type;
+  res = optimize_node(res);
+  IRN_VRFY_IRG(res, irg);
+  return res;
+}
+
 /* --------------------------------------------- */
 /* private interfaces, for professional use only */
 /* --------------------------------------------- */
@@ -1700,6 +1723,18 @@ new_rd_Mux  (dbg_info *db, ir_graph *irg, ir_node *block,
   return res;
 }
 
+ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block,
+    ir_node *store, ir_node *dst, ir_node *src, type *data_type)
+{
+  ir_node  *res;
+  ir_graph *rem = current_ir_graph;
+
+  current_ir_graph = irg;
+  res = new_bd_CopyB(db, block, store, dst, src, data_type);
+  current_ir_graph = rem;
+
+  return res;
+}
 
 ir_node *new_r_Block  (ir_graph *irg,  int arity, ir_node **in) {
   return new_rd_Block(NULL, irg, arity, in);
@@ -1911,6 +1946,10 @@ ir_node *new_r_Mux (ir_graph *irg, ir_node *block,
   return new_rd_Mux(NULL, irg, block, sel, ir_false, ir_true, mode);
 }
 
+ir_node *new_r_CopyB(ir_graph *irg, ir_node *block,
+    ir_node *store, ir_node *dst, ir_node *src, type *data_type) {
+  return new_rd_CopyB(NULL, irg, block, store, dst, src, data_type);
+}
 
 /** ********************/
 /** public interfaces  */
@@ -2567,10 +2606,15 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins)
          (bad, jmp).  In this case we call the function needlessly, eventually
          generating an non existent error.
          However, this SHOULD NOT HAPPEN, as bad control flow nodes are intercepted
-         before recuring.
+         before recurring.
       */
-      if (default_initialize_local_variable)
+      if (default_initialize_local_variable) {
+        ir_node *rem = get_cur_block();
+
+        set_cur_block(block);
         block->attr.block.graph_arr[pos] = default_initialize_local_variable(current_ir_graph, mode, pos - 1);
+        set_cur_block(rem);
+      }
       else
         block->attr.block.graph_arr[pos] = new_Const(mode, tarval_bad);
       /* We don't need to care about exception ops in the start block.
@@ -3242,6 +3286,17 @@ new_d_Mux (dbg_info *db, ir_node *sel, ir_node *ir_false,
       sel, ir_false, ir_true, mode);
 }
 
+ir_node *new_d_CopyB(dbg_info *db,ir_node *store,
+    ir_node *dst, ir_node *src, type *data_type) {
+  ir_node *res;
+  res = new_bd_CopyB(db, current_ir_graph->current_block,
+    store, dst, src, data_type);
+#if PRECISE_EXC_CONTEXT
+  allocate_frag_arr(res, op_CopyB, &res->attr.copyb.exc.frag_arr);
+#endif
+  return res;
+}
+
 /* ********************************************************************* */
 /* Comfortable interface with automatic Phi node construction.           */
 /* (Uses also constructors of ?? interface, except new_Block.            */
@@ -3570,3 +3625,6 @@ ir_node *new_NoMem  (void) {
 ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode) {
   return new_d_Mux(NULL, sel, ir_false, ir_true, mode);
 }
+ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, type *data_type) {
+  return new_d_CopyB(NULL, store, dst, src, data_type);
+}