X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode.c;h=2cd7b29d0e5cbd345152e6936db89a10a19c8975;hb=f9d25133f86594ca2b1f33fb0b41a591ecc9b914;hp=595faec270230eb07c9a691130b5f01ede117891;hpb=8382494c9bb9f2e02a5a125cc40f453d025a2393;p=libfirm diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 595faec27..2cd7b29d0 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -223,6 +223,7 @@ get_irn_in (const ir_node *node) { void set_irn_in (ir_node *node, int arity, ir_node **in) { + int i; ir_node *** arr; assert(node); if (get_interprocedural_view()) { /* handle Filter and Block specially */ @@ -243,6 +244,11 @@ set_irn_in (ir_node *node, int arity, ir_node **in) { (*arr)[0] = block; } fix_backedges(current_ir_graph->obst, node); + + for (i = 0; i < arity; i++) { + edges_notify_edge(node, i, in[i], (*arr)[i+1], current_ir_graph); + } + memcpy((*arr) + 1, in, sizeof(ir_node *) * arity); } @@ -688,7 +694,7 @@ void set_Block_cg_cfgpred_arr(ir_node * node, int arity, ir_node ** in) { node->attr.block.in_cg[0] = NULL; node->attr.block.cg_backedge = new_backedge_arr(current_ir_graph->obst, arity); { - /* Fix backedge array. fix_backedges operates depending on + /* Fix backedge array. fix_backedges() operates depending on interprocedural_view. */ int ipv = get_interprocedural_view(); set_interprocedural_view(true); @@ -2022,6 +2028,48 @@ void set_Mux_true (ir_node *node, ir_node *ir_true) { node->in[3] = ir_true; } +/* CopyB support */ +ir_node *get_CopyB_mem (ir_node *node) { + assert (node->op == op_CopyB); + return get_irn_n(node, 0); +} + +void set_CopyB_mem (ir_node *node, ir_node *mem) { + assert (node->op == op_CopyB); + set_irn_n(node, 0, mem); +} + +ir_node *get_CopyB_dst (ir_node *node) { + assert (node->op == op_CopyB); + return get_irn_n(node, 1); +} + +void set_CopyB_dst (ir_node *node, ir_node *dst) { + assert (node->op == op_CopyB); + set_irn_n(node, 1, dst); +} + +ir_node *get_CopyB_src (ir_node *node) { + assert (node->op == op_CopyB); + return get_irn_n(node, 2); +} + +void set_CopyB_src (ir_node *node, ir_node *src) { + assert (node->op == op_CopyB); + set_irn_n(node, 2, src); +} + +type *get_CopyB_type(ir_node *node) { + assert (node->op == op_CopyB); + return node->attr.copyb.data_type; +} + +void set_CopyB_type(ir_node *node, type *data_type) { + assert (node->op == op_CopyB && data_type); + node->attr.copyb.data_type = data_type; +} + + ir_graph * get_irn_irg(const ir_node *node) { /* @@ -2264,12 +2312,23 @@ int (is_irn_constlike)(const ir_node *node) { return _is_irn_constlike(node); } -/* Returns the conditional jump predication of a Cond node. */ +/* Gets the string representation of the jump prediction .*/ +const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred) +{ + switch (pred) { + default: + case COND_JMP_PRED_NONE: return "no prediction"; + case COND_JMP_PRED_TRUE: return "true taken"; + case COND_JMP_PRED_FALSE: return "false taken"; + } +} + +/* Returns the conditional jump prediction of a Cond node. */ cond_jmp_predicate (get_Cond_jmp_pred)(ir_node *cond) { return _get_Cond_jmp_pred(cond); } -/* Sets a new conditional jump predication. */ +/* Sets a new conditional jump prediction. */ void (set_Cond_jmp_pred)(ir_node *cond, cond_jmp_predicate pred) { _set_Cond_jmp_pred(cond, pred); }