irnode: Remove unnecessary skip_Proj() from get_Block_cfgpred_block_().
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 27 Nov 2012 07:03:10 +0000 (08:03 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 27 Nov 2012 10:16:15 +0000 (11:16 +0100)
Projs are always in the same block as their predecessor.

include/libfirm/irnode.h
ir/ir/irnode_t.h

index 0f457b5..52e6384 100644 (file)
@@ -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);
 
index 37d8a1b..1ce7f53 100644 (file)
@@ -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);
        }
 }