Commit 3ce6d7f8 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

added test for cast

[r2861]
parent f2c04f1b
......@@ -1817,6 +1817,8 @@ ir_graph *
get_irn_irg(ir_node *node) {
if (get_irn_op(node) != op_Block)
node = get_nodes_block(node);
if (is_Bad(node)) /* sometimes bad is predecessor of nodes instead of block: in case of optimization */
node = get_nodes_block(node);
assert(get_irn_op(node) == op_Block);
return node->attr.block.irg;
}
......@@ -1853,6 +1855,15 @@ skip_Tuple (ir_node *node) {
return node;
}
/** returns operand of node if node is a Cast */
ir_node *skip_Cast (ir_node *node) {
if (node && get_irn_op(node) == op_Cast) {
return skip_nop(get_irn_n(node, 0));
} else {
return node;
}
}
#if 0
/* This should compact Id-cycles to self-cycles. It has the same (or less?) complexity
than any other approach, as Id chains are resolved and all point to the real node, or
......
......@@ -807,6 +807,8 @@ ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */
/* returns corresponding operand of Tuple if node is a Proj from
a Tuple. */
ir_node *skip_Tuple (ir_node *node);
/** returns operand of node if node is a Cast */
ir_node *skip_Cast (ir_node *node);
/** returns true if node is a Bad node. */
int is_Bad (ir_node *node);
/** returns true if the node is not a Block */
......
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