X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2FTEMPLATE%2FTEMPLATE_emitter.c;h=7f2b1ad48f06012c49776f271dde80b4fc4980df;hb=223381b39ed8606f5dbf94a7c1f59fd9e0b6d249;hp=52785fc9a0a7f0d5d16ac6f4695f5d2338973a5f;hpb=b0e09fe0aada2e5d9dc0299e969b3c93c1092d97;p=libfirm diff --git a/ir/be/TEMPLATE/TEMPLATE_emitter.c b/ir/be/TEMPLATE/TEMPLATE_emitter.c index 52785fc9a..7f2b1ad48 100644 --- a/ir/be/TEMPLATE/TEMPLATE_emitter.c +++ b/ir/be/TEMPLATE/TEMPLATE_emitter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,9 +22,7 @@ * @brief emit assembler for a backend graph * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include @@ -44,12 +42,9 @@ #include "gen_TEMPLATE_emitter.h" #include "TEMPLATE_nodes_attr.h" #include "TEMPLATE_new_nodes.h" -#include "TEMPLATE_map_regs.h" #define SNPRINTF_BUF_LEN 128 -static const arch_env_t *arch_env; - /** * Returns the register at in position pos. */ @@ -64,7 +59,7 @@ static const arch_register_t *get_in_reg(const ir_node *node, int 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; @@ -84,9 +79,9 @@ static const arch_register_t *get_out_reg(const ir_node *node, int pos) /* 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_TEMPLATE_irn(node)) { - reg = get_TEMPLATE_out_reg(node, pos); + reg = arch_irn_get_register(node, pos); } else { const ir_edge_t *edge; @@ -94,7 +89,7 @@ static const arch_register_t *get_out_reg(const ir_node *node, int pos) 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; } } @@ -273,9 +268,9 @@ void TEMPLATE_gen_labels(ir_node *block, void *env) { /** * Main driver */ -void TEMPLATE_gen_routine(const TEMPLATE_code_gen_t *cg, ir_graph *irg) { - - arch_env = cg->arch_env; +void TEMPLATE_gen_routine(const TEMPLATE_code_gen_t *cg, ir_graph *irg) +{ + (void)cg; /* register all emitter functions */ TEMPLATE_register_emitters();