X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fmips%2Fmips_emitter.c;h=d1d34750e62788a814f09ab686fe721c38748a9e;hb=6d64da24e970f54e9c55b6df1e81c6925492c4ed;hp=bcd4f4d233a9f163c8b3949f7d9971e1378bdefc;hpb=605afb45243e9d7c246760d4f1452dfb575b87d6;p=libfirm diff --git a/ir/be/mips/mips_emitter.c b/ir/be/mips/mips_emitter.c index bcd4f4d23..d1d34750e 100644 --- a/ir/be/mips/mips_emitter.c +++ b/ir/be/mips/mips_emitter.c @@ -160,7 +160,7 @@ static const char *get_symconst_str(ir_node *node) id = get_entity_ident(get_SymConst_entity(node)); return get_id_str(id); default: - assert(0); + panic("Unsupported SymConst kind"); } return NULL; @@ -311,13 +311,11 @@ void mips_emit_IncSP(const ir_node *node) int offset = be_get_IncSP_offset(node); if(offset == 0) { - be_emit_cstring("\t/* omitted IncSP with 0 */"); - be_emit_finish_line_gas(node); return; } if(offset > 0xffff || offset < -0xffff) { - panic("stackframe > 2^16 bytes not supported yet\n"); + panic("stackframe > 2^16 bytes not supported yet"); } if(offset > 0) { @@ -436,7 +434,7 @@ static void mips_emit_block_label(const ir_node *block) be_emit_irprintf("%lu", get_Block_label(block)); } else { be_emit_cstring(BLOCK_PREFIX); - be_emit_irprintf("%d", get_irn_node_nr(block)); + be_emit_irprintf("%ld", get_irn_node_nr(block)); } } @@ -556,11 +554,11 @@ void emit_mips_jump_table(const ir_node *irn) const mips_attr_t *attr = get_mips_attr_const(irn); /* fill the table structure */ - tbl.label = xmalloc(SNPRINTF_BUF_LEN); + tbl.label = XMALLOCN(char, SNPRINTF_BUF_LEN); tbl.label = get_unique_label(tbl.label, SNPRINTF_BUF_LEN, "JMPTBL_"); tbl.defBlock = NULL; tbl.num_branches = get_irn_n_edges(irn); - tbl.branches = xcalloc(tbl.num_branches, sizeof(tbl.branches[0])); + tbl.branches = XMALLOCNZ(branch_t, tbl.num_branches); tbl.min_value = INT_MAX; tbl.max_value = INT_MIN; @@ -816,10 +814,9 @@ void mips_gen_routine(mips_code_gen_t *mips_cg, ir_graph *irg) mips_emit_func_prolog(irg); - dump_ir_block_graph_sched(irg, "-kaputtelist"); - - for (i = 0, n = mips_get_sched_n_blocks(cg); i < n; ++i) { - ir_node *block = mips_get_sched_block(cg, i); + n = ARR_LEN(cg->block_schedule); + for (i = 0; i < n; ++i) { + ir_node *block = cg->block_schedule[i]; mips_gen_block(block); }