- Split bearch.h correctly into bearch.h and bearch_t.h
[libfirm] / ir / be / arm / arm_emitter.c
index a4682a4..5b93963 100644 (file)
@@ -19,6 +19,8 @@
 #include "irargs_t.h"
 
 #include "../besched.h"
+#include "../beblocksched.h"
+#include "../beirg_t.h"
 
 #include "arm_emitter.h"
 #include "gen_arm_emitter.h"
@@ -350,17 +352,6 @@ static unsigned get_unique_label(void) {
        return ++id;
 }
 
-
-/**
- * Returns the target label for a control flow node.
- */
-static char *get_cfop_target(const ir_node *irn, char *buf) {
-       ir_node *bl = get_irn_link(irn);
-
-       snprintf(buf, SNPRINTF_BUF_LEN, "BLOCK_%ld", get_irn_node_nr(bl));
-       return buf;
-}
-
 /**
  * Emit a SymConst
  */
@@ -537,7 +528,7 @@ static void emit_arm_SwitchJmp(ir_node *irn, void *env) {
        ir_node **projs;
        int n_projs;
        int block_nr;
-       int default_block_num;
+       int default_block_num = -1;
 
        block_nr = get_irn_node_nr(irn);
        n_projs = get_arm_n_projs(irn);
@@ -553,6 +544,7 @@ static void emit_arm_SwitchJmp(ir_node *irn, void *env) {
 
                projs[get_Proj_proj(proj)] = proj;
        }
+       assert(default_block_num >= 0);
 
        // CMP %1S, n_projs - 1
        // BHI default
@@ -962,7 +954,7 @@ void arm_gen_routine(FILE *F, ir_graph *irg, const arm_code_gen_t *cg) {
        arm_register_emitters();
 
        /* create the block schedule. For now, we don't need it earlier. */
-       blk_sched = sched_create_block_schedule(cg->irg, cg->birg->exec_freq);
+       blk_sched = be_create_block_schedule(cg->irg, cg->birg->exec_freq);
 
        arm_emit_start(F, irg);
        irg_block_walk_graph(irg, arm_gen_labels, NULL, &emit_env);