adapted to new code generator callback (spill)
[libfirm] / ir / be / arm / arm_emitter.c
index b206413..685c68b 100644 (file)
@@ -103,12 +103,10 @@ static const char *node_offset_to_str(ir_node *n, char *buf, int buflen) {
                entity *ent = be_get_frame_entity(n);
                offset = get_entity_offset_bytes(ent);
        } else if (irn_op == op_be_Reload || irn_op == op_be_Spill) {
-               entity * ent = be_get_spill_entity(n);
+               entity *ent = be_get_frame_entity(n);
                offset = get_entity_offset_bytes(ent);
        } else if (irn_op == op_be_IncSP) {
-               int offs = be_get_IncSP_offset(n);
-               be_stack_dir_t dir  = be_get_IncSP_direction(n);
-               offset = (dir == be_stack_dir_expand) ? -offs : offs;
+               offset = - be_get_IncSP_offset(n);
        } else {
                return "node_offset_to_str will fuer diesen Knotentyp noch implementiert werden";
        }
@@ -356,7 +354,7 @@ static unsigned get_unique_label(void) {
 static char *get_cfop_target(const ir_node *irn, char *buf) {
        ir_node *bl = get_irn_link(irn);
 
-       snprintf(buf, SNPRINTF_BUF_LEN, "BLOCK_%d", get_irn_node_nr(bl));
+       snprintf(buf, SNPRINTF_BUF_LEN, "BLOCK_%ld", get_irn_node_nr(bl));
        return buf;
 }
 
@@ -417,10 +415,10 @@ static void emit_arm_CondJmp(ir_node *irn, void *env) {
 
        if (proj_num == pn_Cmp_False) {
                /* always false: should not happen */
-               fprintf(out, "\tb BLOCK_%d\t\t\t/* false case */\n", get_irn_node_nr(false_block));
+               fprintf(out, "\tb BLOCK_%ld\t\t\t/* false case */\n", get_irn_node_nr(false_block));
        } else if (proj_num == pn_Cmp_True) {
                /* always true: should not happen */
-               fprintf(out, "\tb BLOCK_%d\t\t\t/* true case */\n", get_irn_node_nr(true_block));
+               fprintf(out, "\tb BLOCK_%ld\t\t\t/* true case */\n", get_irn_node_nr(true_block));
        } else {
                ir_node *block = get_nodes_block(irn);
 
@@ -624,8 +622,9 @@ static void emit_be_Call(ir_node *irn, void *env) {
 /** Emit an IncSP node */
 static void emit_be_IncSP(const ir_node *irn, arm_emit_env_t *emit_env) {
        FILE *F = emit_env->out;
-       unsigned offs = be_get_IncSP_offset(irn);
-       if (offs) {
+       int offs = be_get_IncSP_offset(irn);
+
+       if (offs != 0) {
                char cmd_buf[SNPRINTF_BUF_LEN], cmnt_buf[SNPRINTF_BUF_LEN];
                lc_esnprintf(arm_get_arg_env(), cmd_buf, SNPRINTF_BUF_LEN, "add %1D, %1S, #%O", irn, irn, irn );
                lc_esnprintf(arm_get_arg_env(), cmnt_buf, SNPRINTF_BUF_LEN, "/* IncSP(%O) */", irn);
@@ -732,7 +731,6 @@ static void emit_be_Reload(const ir_node* irn, arm_emit_env_t *emit_env) {
 
 static void emit_be_Perm(const ir_node* irn, arm_emit_env_t *emit_env) {
        FILE *F = emit_env->out;
-       ir_mode *mode = get_irn_mode(irn);
        const lc_arg_env_t *arm_env = arm_get_arg_env();
        char cmd_buf[SNPRINTF_BUF_LEN], cmnt_buf[SNPRINTF_BUF_LEN];
 
@@ -896,7 +894,7 @@ static void arm_emit_node(const ir_node *irn, void *env) {
 void arm_gen_block(ir_node *block, void *env) {
        ir_node *irn;
 
-       fprintf(((arm_emit_env_t *)env)->out, "BLOCK_%d:\n", get_irn_node_nr(block));
+       fprintf(((arm_emit_env_t *)env)->out, "BLOCK_%ld:\n", get_irn_node_nr(block));
        sched_foreach(block, irn) {
                arm_emit_node(irn, env);
        }
@@ -961,7 +959,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);
+       blk_sched = sched_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);