summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beemithlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-10-31 12:26:05 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-10-31 12:30:17 +0100
commitbba5f077e1e03e7d866fd607d1080b9f2b1115b7 (patch)
treed2ceb46a2d122101c85a465fb7b846d934f3e700 /ir/be/beemithlp.c
parent4f9714f27f189a553424a7489ab08d45d35a89e3 (diff)
be: Factor out common code to check whether a jump falls through.
Diffstat (limited to 'ir/be/beemithlp.c')
-rw-r--r--ir/be/beemithlp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ir/be/beemithlp.c b/ir/be/beemithlp.c
index 8fb8838..cfff189 100644
--- a/ir/be/beemithlp.c
+++ b/ir/be/beemithlp.c
@@ -92,3 +92,10 @@ void be_emit_cfop_target(ir_node const *const jmp)
ir_node *const target = be_emit_get_cfop_target(jmp);
be_gas_emit_block_name(target);
}
+
+bool be_is_fallthrough(ir_node const *const jmp)
+{
+ ir_node *const block = get_nodes_block(jmp);
+ ir_node *const target = be_emit_get_cfop_target(jmp);
+ return be_emit_get_prev_block(target) == block;
+}