Commit 89be0b49 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

irnode: Remove unnecessary skip_Proj() from get_Block_cfgpred_block_().

Projs are always in the same block as their predecessor.
parent 5fb77a1e
......@@ -264,16 +264,13 @@ FIRM_API void set_Block_cfgpred(ir_node *block, int pos, ir_node *pred);
*/
FIRM_API int get_Block_cfgpred_pos(const ir_node *block, const ir_node *pred);
/** Returns the predecessor block.
/**
* Returns the predecessor block.
*
* Returns the block corresponding to the predecessor pos of block.
* Returns the block corresponding to the predecessor pos of block.
*
* There are several ambiguities we resolve with this function:
* - The direct predecessor can be a Proj, which is not pinned.
* We walk from the predecessor to the next pinned node
* (skip_Proj) and return the block that node is in.
* - If we encounter the Bad node, this function does not return
* Start block, but the Bad node.
* If we encounter the Bad node, this function does not return Start block, but
* the Bad node.
*/
FIRM_API ir_node *get_Block_cfgpred_block(const ir_node *node, int pos);
......
......@@ -392,16 +392,13 @@ static inline ir_node *get_Block_cfgpred_(const ir_node *node, int pos)
return get_irn_n_(node, pos);
}
/* Get the predecessor block.
/**
* Get the predecessor block.
*
* Returns the block corresponding to the predecessor pos.
* Returns the block corresponding to the predecessor pos.
*
* There are several ambiguities we resolve with this function:
* - The direct predecessor can be a Proj, which is not pinned.
* We walk from the predecessor to the next pinned node
* (skip_Proj) and return the block that node is in.
* - If we encounter the Bad node, this function does not return
* the Start block, but the Bad node.
* If we encounter the Bad node, this function does not return the Start block,
* but the Bad node.
*/
static inline ir_node *get_Block_cfgpred_block_(const ir_node *node, int pos)
{
......@@ -411,7 +408,7 @@ static inline ir_node *get_Block_cfgpred_block_(const ir_node *node, int pos)
ir_graph *irg = get_irn_irg(node);
return new_r_Bad(irg, mode_BB);
} else {
return get_nodes_block(skip_Proj(res));
return get_nodes_block(res);
}
}
......
Markdown is supported
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