Commit b69638dc authored by Michael Beck's avatar Michael Beck
Browse files

- is_Bound added

- renamed variable to make code more understandable

[r17274]
parent 246d79b1
......@@ -1264,6 +1264,8 @@ int is_Rot(const ir_node *node);
int is_Psi(const ir_node *node);
/** Returns true if node is a Tuple node. */
int is_Tuple(const ir_node *node);
/** Returns true if node is a Bound node. */
int is_Bound(const ir_node *node);
/** Returns true if the node is not a Block */
int is_no_Block(const ir_node *node);
/** Returns true if the node is a Block */
......
......@@ -228,40 +228,41 @@ get_irn_in(const ir_node *node) {
void
set_irn_in(ir_node *node, int arity, ir_node **in) {
int i;
ir_node *** arr;
ir_node *** pOld_in;
ir_graph *irg = current_ir_graph;
assert(node);
if (get_interprocedural_view()) { /* handle Filter and Block specially */
if (get_irn_opcode(node) == iro_Filter) {
ir_opcode code = get_irn_opcode(node);
if (code == iro_Filter) {
assert(node->attr.filter.in_cg);
arr = &node->attr.filter.in_cg;
} else if (get_irn_opcode(node) == iro_Block && node->attr.block.in_cg) {
arr = &node->attr.block.in_cg;
pOld_in = &node->attr.filter.in_cg;
} else if (code == iro_Block && node->attr.block.in_cg) {
pOld_in = &node->attr.block.in_cg;
} else {
arr = &node->in;
pOld_in = &node->in;
}
} else {
arr = &node->in;
pOld_in = &node->in;
}
for (i = 0; i < arity; i++) {
if (i < ARR_LEN(*arr)-1)
edges_notify_edge(node, i, in[i], (*arr)[i+1], irg);
if (i < ARR_LEN(*pOld_in)-1)
edges_notify_edge(node, i, in[i], (*pOld_in)[i+1], irg);
else
edges_notify_edge(node, i, in[i], NULL, irg);
}
for(;i < ARR_LEN(*arr)-1; i++) {
edges_notify_edge(node, i, NULL, (*arr)[i+1], irg);
for (;i < ARR_LEN(*pOld_in)-1; i++) {
edges_notify_edge(node, i, NULL, (*pOld_in)[i+1], irg);
}
if (arity != ARR_LEN(*arr) - 1) {
ir_node * block = (*arr)[0];
*arr = NEW_ARR_D(ir_node *, irg->obst, arity + 1);
(*arr)[0] = block;
if (arity != ARR_LEN(*pOld_in) - 1) {
ir_node * block = (*pOld_in)[0];
*pOld_in = NEW_ARR_D(ir_node *, irg->obst, arity + 1);
(*pOld_in)[0] = block;
}
fix_backedges(irg->obst, node);
memcpy((*arr) + 1, in, sizeof(ir_node *) * arity);
memcpy((*pOld_in) + 1, in, sizeof(ir_node *) * arity);
}
ir_node *
......@@ -2709,6 +2710,11 @@ int
return _is_Tuple(node);
}
int
(is_Bound)(const ir_node *node) {
return _is_Bound(node);
}
int
(is_Start)(const ir_node *node) {
return _is_Start(node);
......
......@@ -544,6 +544,12 @@ _is_Tuple(const ir_node *node) {
return (_get_irn_op(node) == op_Tuple);
}
static INLINE int
_is_Bound(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Bound);
}
static INLINE int
_is_Start(const ir_node *node) {
assert(node);
......@@ -975,6 +981,7 @@ static INLINE void _set_irn_dbg_info(ir_node *n, dbg_info *db) {
#define is_Rot(node) _is_Rot(node)
#define is_Psi(node) _is_Psi(node)
#define is_Tuple(node) _is_Tuple(node)
#define is_Bound(node) _is_Bound(node)
#define is_no_Block(node) _is_no_Block(node)
#define is_Block(node) _is_Block(node)
#define get_Block_n_cfgpreds(node) _get_Block_n_cfgpreds(node)
......
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