summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2017-01-09 13:18:29 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2017-01-12 12:45:04 +0100
commit00be7779bfb5c3eb2c2eff8c0c29ffcbec78f793 (patch)
tree50fd04c3641d4c95720a3a21c51762c91ef0cfe1 /ir/be/betranshlp.c
parente1e04a12b4a39444d0d14feb555a5724c0c0f47e (diff)
be: Make the function to get the output position of a node for given register backend-generic.
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index 1d78376..c34a0f9 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -953,3 +953,13 @@ ir_node *be_make_Sync(ir_node *const block, int const arity, ir_node **const ins
arity == 1 ? ins[0] :
new_r_Sync(block, arity, ins);
}
+
+unsigned be_get_out_for_reg(ir_node const *const node, arch_register_t const *const reg)
+{
+ be_foreach_out(node, o) {
+ arch_register_req_t const *const req = arch_get_irn_register_req_out(node, o);
+ if (req == reg->single_req)
+ return o;
+ }
+ panic("register requirement not found");
+}