summaryrefslogtreecommitdiffhomepage
path: root/ir/be/TEMPLATE
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-08 06:09:24 +0100
committerMatthias Braun <matze@braunis.de>2016-02-08 06:09:38 +0100
commitc82b415bdad26e4fd9ba7a4c2921500b6bb31bc7 (patch)
tree52c1b1563dc021516013d2fa65cca11bbc0be292 /ir/be/TEMPLATE
parenta6aacda304195e4097a0fa120baab462abcbaa83 (diff)
be: Merge common emitter code to query jump targets and block schedule
Diffstat (limited to 'ir/be/TEMPLATE')
-rw-r--r--ir/be/TEMPLATE/TEMPLATE_emitter.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/ir/be/TEMPLATE/TEMPLATE_emitter.c b/ir/be/TEMPLATE/TEMPLATE_emitter.c
index ffa976b..bec80aa 100644
--- a/ir/be/TEMPLATE/TEMPLATE_emitter.c
+++ b/ir/be/TEMPLATE/TEMPLATE_emitter.c
@@ -57,7 +57,7 @@ static void TEMPLATE_emit_dest_register(const ir_node *node, int pos)
*/
static void TEMPLATE_emit_cfop_target(const ir_node *node)
{
- ir_node *block = (ir_node*)get_irn_link(node);
+ ir_node *block = be_emit_get_cfop_target(node);
be_gas_emit_block_name(block);
}
@@ -221,18 +221,6 @@ static void TEMPLATE_emit_block(ir_node *block)
}
}
-/**
- * Sets labels for control flow nodes (jump target)
- */
-static void TEMPLATE_gen_labels(ir_node *block, void *env)
-{
- (void)env;
- for (int n = get_Block_n_cfgpreds(block); n-- > 0; ) {
- ir_node *pred = get_Block_cfgpred(block, n);
- set_irn_link(pred, block);
- }
-}
-
void TEMPLATE_emit_function(ir_graph *irg)
{
/* register all emitter functions */
@@ -247,7 +235,8 @@ void TEMPLATE_emit_function(ir_graph *irg)
/* populate jump link fields with their destinations */
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
- irg_block_walk_graph(irg, TEMPLATE_gen_labels, NULL, NULL);
+
+ be_emit_init_cf_links(block_schedule);
for (size_t i = 0, n = ARR_LEN(block_schedule); i < n; ++i) {
ir_node *block = block_schedule[i];