summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-08-07 22:27:05 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-08-07 22:28:45 +0200
commit4ca20458be1edbf4b77098535c56f6d934aa1afd (patch)
tree782f367f902378a1cef0b4e75d71e7aa2f18ac18 /ir/be/benode.c
parentaea257b0796ee5958292f7068f550cbf8e5a23f5 (diff)
be: Add and use be_get_or_make_Proj_for_pn().
Diffstat (limited to 'ir/be/benode.c')
-rw-r--r--ir/be/benode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index fe49fcf..7253ab8 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -416,8 +416,7 @@ ir_node *be_get_initial_reg_value(ir_graph *irg, const arch_register_t *reg)
{
unsigned const i = get_start_reg_index(irg, reg);
ir_node *const start = get_irg_start(irg);
- ir_node *const proj = get_Proj_for_pn(start, i);
- return proj ? proj : be_new_Proj(start, i);
+ return be_get_or_make_Proj_for_pn(start, i);
}
ir_node *be_new_Phi(ir_node *block, int n_ins, ir_node **ins, ir_mode *mode,
@@ -529,6 +528,12 @@ ir_node *be_new_Proj(ir_node *const pred, unsigned const pos)
return new_r_Proj(pred, req->cls->mode, pos);
}
+ir_node *be_get_or_make_Proj_for_pn(ir_node *const irn, unsigned const pn)
+{
+ ir_node *const proj = get_Proj_for_pn(irn, pn);
+ return proj ? proj : be_new_Proj(irn, pn);
+}
+
/**
* ir_op-Operation: dump a be node to file
*/