* @author Matthias Braun, Mehdi
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include <limits.h>
#define SNPRINTF_BUF_LEN 128
-static const mips_isa_t *isa;
-static const arch_env_t *arch_env;
-static const mips_code_gen_t *cg;
-
/**
* Returns the register at in position pos.
*/
in register we need. */
op = get_irn_n(node, pos);
- reg = arch_get_irn_register(arch_env, op);
+ reg = arch_get_irn_register(op);
assert(reg && "no in register found");
return reg;
/* Proj with the corresponding projnum for the register */
if (get_irn_mode(node) != mode_T) {
- reg = arch_get_irn_register(arch_env, node);
+ reg = arch_get_irn_register(node);
} else if (is_mips_irn(node)) {
reg = get_mips_out_reg(node, pos);
} else {
proj = get_edge_src_irn(edge);
assert(is_Proj(proj) && "non-Proj from mode_T node");
if (get_Proj_proj(proj) == pos) {
- reg = arch_get_irn_register(arch_env, proj);
+ reg = arch_get_irn_register(proj);
break;
}
}
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;
{
int i, n;
- cg = mips_cg;
- isa = (const mips_isa_t*) cg->arch_env;
- arch_env = cg->arch_env;
-
mips_register_emitters();
irg_block_walk_graph(irg, mips_gen_labels, NULL, NULL);
mips_emit_func_prolog(irg);
- n = ARR_LEN(cg->block_schedule);
+ n = ARR_LEN(mips_cg->block_schedule);
for (i = 0; i < n; ++i) {
- ir_node *block = cg->block_schedule[i];
+ ir_node *block = mips_cg->block_schedule[i];
mips_gen_block(block);
}