From 89be0b49f0d8da284c9cbbbf048c7fba0574769d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 27 Nov 2012 08:03:10 +0100 Subject: [PATCH] irnode: Remove unnecessary skip_Proj() from get_Block_cfgpred_block_(). Projs are always in the same block as their predecessor. --- include/libfirm/irnode.h | 13 +++++-------- ir/ir/irnode_t.h | 15 ++++++--------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/include/libfirm/irnode.h b/include/libfirm/irnode.h index 0f457b55d..52e638421 100644 --- a/include/libfirm/irnode.h +++ b/include/libfirm/irnode.h @@ -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); diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 37d8a1b78..1ce7f536a 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -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); } } -- 2.20.1