Commit 385e7b76 authored by Michael Beck's avatar Michael Beck
Browse files

added support functions for CopyB node

[r6688]
parent 169fd803
......@@ -694,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);
......@@ -2028,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) {
/*
......
......@@ -937,6 +937,26 @@ void set_Mux_false (ir_node *node, ir_node *ir_false);
ir_node *get_Mux_true (ir_node *node);
void set_Mux_true (ir_node *node, ir_node *ir_true);
/**
* Projection numbers for result of CopyB node: use for Proj nodes!
*/
typedef enum {
pn_CopyB_M_regular = pn_Call_M_regular, /**< The memory result. */
pn_CopyB_X_except = pn_Call_X_except, /**< The control flow result branching to the exception handler */
pn_CopyB_M_except = pn_Call_M_except, /**< The memory result in case the runtime function terminated with
an exception */
pn_CopyB_max = pn_Call_max /**< number of projections from a CopyB */
} pn_CopyB; /* Projection numbers for CopyB. */
#define pn_CopyB_M pn_CopyB_M_regular
ir_node *get_CopyB_mem (ir_node *node);
void set_CopyB_mem (ir_node *node, ir_node *mem);
ir_node *get_CopyB_dst (ir_node *node);
void set_CopyB_dst (ir_node *node, ir_node *dst);
ir_node *get_CopyB_src (ir_node *node);
void set_CopyB_src (ir_node *node, ir_node *src);
type *get_CopyB_type(ir_node *node);
void set_CopyB_type(ir_node *node, type *data_type);
/*
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment