Commit 54c5bada authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Remove struct arch_env_t.

parent b18c2537
......@@ -38,6 +38,8 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
pmap *sparc_constants;
ir_mode *sparc_mode_Q;
typedef enum {
......@@ -379,25 +381,17 @@ static void sparc_finish(void)
sparc_free_opcodes();
}
static arch_env_t *sparc_begin_codegeneration(void)
static void sparc_begin_codegeneration(void)
{
sparc_isa_t *isa = XMALLOC(sparc_isa_t);
isa->constants = pmap_create();
sparc_constants = pmap_create();
be_gas_elf_type_char = '#';
be_gas_elf_variant = ELF_VARIANT_SPARC;
return &isa->base;
}
/**
* Closes the output file and frees the ISA structure.
*/
static void sparc_end_codegeneration(void *self)
static void sparc_end_codegeneration(void)
{
sparc_isa_t *isa = (sparc_isa_t*)self;
pmap_destroy(isa->constants);
free(isa);
pmap_destroy(sparc_constants);
}
static void sparc_lower_for_target(void)
......
......@@ -24,10 +24,7 @@ typedef struct sparc_codegen_config_t {
} sparc_codegen_config_t;
extern sparc_codegen_config_t sparc_cg_config;
typedef struct sparc_isa_t {
arch_env_t base; /**< must be derived from arch_env_t */
pmap *constants;
} sparc_isa_t;
extern pmap *sparc_constants;
extern ir_mode *sparc_mode_Q;
......
......@@ -1356,11 +1356,9 @@ static ir_node *gen_Minus(ir_node *node)
/**
* Create an entity for a given (floating point) tarval
*/
static ir_entity *create_float_const_entity(ir_graph *const irg, ir_tarval *const tv)
static ir_entity *create_float_const_entity(ir_tarval *const tv)
{
const arch_env_t *arch_env = be_get_irg_arch_env(irg);
sparc_isa_t *isa = (sparc_isa_t*) arch_env;
ir_entity *entity = pmap_get(ir_entity, isa->constants, tv);
ir_entity *entity = pmap_get(ir_entity, sparc_constants, tv);
if (entity != NULL)
return entity;
......@@ -1374,15 +1372,15 @@ static ir_entity *create_float_const_entity(ir_graph *const irg, ir_tarval *cons
ir_initializer_t *initializer = create_initializer_tarval(tv);
set_entity_initializer(entity, initializer);
pmap_insert(isa->constants, tv, entity);
pmap_insert(sparc_constants, tv, entity);
return entity;
}
static ir_node *gen_float_const(dbg_info *dbgi, ir_node *block, ir_tarval *tv)
{
ir_graph *irg = get_irn_irg(block);
ir_entity *entity = create_float_const_entity(irg, tv);
ir_entity *entity = create_float_const_entity(tv);
ir_node *hi = new_bd_sparc_SetHi(dbgi, block, entity, 0);
ir_graph *irg = get_irn_irg(block);
ir_node *mem = get_irg_no_mem(irg);
ir_mode *mode = get_tarval_mode(tv);
ir_node *new_op
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment