# 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.
ir_node *res;
ir_graph *irg = current_ir_graph;
int i;
- bool has_unknown = false;
+ int has_unknown = 0;
/* Don't assert that block matured: the use of this constructor is strongly
restricted ... */
for (i = arity-1; i >= 0; i--)
if (get_irn_op(in[i]) == op_Unknown) {
- has_unknown = true;
+ has_unknown = 1;
break;
}
res = new_ir_node (db, irg, block, op_Sub, mode, 2, in);
res = optimize_node (res);
IRN_VRFY_IRG(res, irg);
+
return res;
}
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 */
/* --------------------------------------------- */
return res;
}
+ir_node *
+new_rd_simpleSel (dbg_info *db, ir_graph *irg, ir_node *block,
+ ir_node *store, ir_node *objptr, entity *ent)
+{
+ ir_node *res;
+ ir_graph *rem = current_ir_graph;
+
+ current_ir_graph = irg;
+ res = new_bd_Sel(db, block, store, objptr, 0, NULL, ent);
+ current_ir_graph = rem;
+
+ return res;
+}
+
ir_node *
new_rd_Sel (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr,
int arity, ir_node **in, entity *ent)
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);
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 */
{
ir_node *res;
int i;
- bool has_unknown = false;
+ int has_unknown = 0;
res = new_bd_Block(db, arity, in);
for (i = arity-1; i >= 0; i--)
if (get_irn_op(in[i]) == op_Unknown) {
- has_unknown = true;
+ has_unknown = 1;
break;
}
(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.
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. */
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);
+}