Commit 487f52ef authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Do not explicitly pass an obstack to be_make_start_out().

Get the obstack from the given start node.
parent 7cbfeeea
......@@ -1419,7 +1419,6 @@ static ir_node *gen_Start(ir_node *node)
ir_type *function_type = get_entity_type(entity);
ir_node *new_block = be_transform_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
struct obstack *obst = be_get_be_obst(irg);
x86_cconv_t const *const cconv = current_cconv;
......@@ -1441,7 +1440,7 @@ static ir_node *gen_Start(ir_node *node)
be_make_start_mem(&start_mem, start, o++);
/* the stack pointer */
be_make_start_out(&start_val[REG_RSP], obst, start, o++, &amd64_registers[REG_RSP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
be_make_start_out(&start_val[REG_RSP], start, o++, &amd64_registers[REG_RSP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
/* function parameters in registers */
const unsigned *allocatable_regs = be_birg_from_irg(irg)->allocatable_regs;
......@@ -1464,7 +1463,7 @@ static ir_node *gen_Start(ir_node *node)
arch_register_req_type_t const flags =
i == REG_RBP && !cconv->omit_fp ? arch_register_req_type_ignore :
arch_register_req_type_none;
be_make_start_out(&start_val[i], obst, start, o++, &amd64_registers[i], flags);
be_make_start_out(&start_val[i], start, o++, &amd64_registers[i], flags);
}
assert(n_outs == o);
......
......@@ -1720,7 +1720,6 @@ static ir_node *gen_Start(ir_node *node)
ir_type *function_type = get_entity_type(entity);
ir_node *new_block = be_transform_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
struct obstack *obst = be_get_be_obst(irg);
unsigned n_outs = 2; /* memory, sp */
n_outs += cconv->n_param_regs;
......@@ -1730,7 +1729,7 @@ static ir_node *gen_Start(ir_node *node)
be_make_start_mem(&start_mem, start, o++);
be_make_start_out(&start_sp, obst, start, o++, &arm_registers[REG_SP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
be_make_start_out(&start_sp, start, o++, &arm_registers[REG_SP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
/* function parameters in registers */
start_params_offset = o;
......
......@@ -12,6 +12,7 @@
#include "bearch.h"
#include "benode.h"
#include "beinfo.h"
#include "beirg.h"
#include "ircons_t.h"
#include "irnode_t.h"
#include "irop_t.h"
......@@ -96,13 +97,13 @@ void be_make_start_mem(be_start_info_t *const info, ir_node *const start, unsign
arch_set_irn_register_req_out(start, pos, arch_no_register_req);
}
void be_make_start_out(be_start_info_t *const info, struct obstack *const obst, ir_node *const start, unsigned const pos, arch_register_t const *const reg, arch_register_req_type_t const flags)
void be_make_start_out(be_start_info_t *const info, ir_node *const start, unsigned const pos, arch_register_t const *const reg, arch_register_req_type_t const flags)
{
info->pos = pos;
info->irn = NULL;
arch_register_req_t const *const req =
flags == arch_register_req_type_none ? reg->single_req :
be_create_reg_req(obst, reg, flags);
be_create_reg_req(be_get_be_obst(get_irn_irg(start)), reg, flags);
arch_set_irn_register_req_out(start, pos, req);
arch_set_irn_register_out(start, pos, reg);
}
......
......@@ -391,7 +391,7 @@ typedef struct be_start_info_t {
void be_make_start_mem(be_start_info_t *info, ir_node *start, unsigned pos);
void be_make_start_out(be_start_info_t *info, struct obstack *obst, ir_node *start, unsigned pos, arch_register_t const *reg, arch_register_req_type_t flags);
void be_make_start_out(be_start_info_t *info, ir_node *start, unsigned pos, arch_register_t const *reg, arch_register_req_type_t flags);
ir_node *be_get_start_proj(ir_graph *irg, be_start_info_t *info);
......
......@@ -4140,7 +4140,6 @@ static ir_node *gen_Start(ir_node *node)
ir_type *function_type = get_entity_type(entity);
ir_node *new_block = be_transform_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
struct obstack *obst = be_get_be_obst(irg);
x86_cconv_t const *const cconv = current_cconv;
......@@ -4162,7 +4161,7 @@ static ir_node *gen_Start(ir_node *node)
be_make_start_mem(&start_mem, start, o++);
/* the stack pointer */
be_make_start_out(&start_val[REG_ESP], obst, start, o++, &ia32_registers[REG_ESP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
be_make_start_out(&start_val[REG_ESP], start, o++, &ia32_registers[REG_ESP], arch_register_req_type_ignore | arch_register_req_type_produces_sp);
/* function parameters in registers */
start_params_offset = o;
......@@ -4183,7 +4182,7 @@ static ir_node *gen_Start(ir_node *node)
arch_register_req_type_t const flags =
i == REG_EBP && !cconv->omit_fp ? arch_register_req_type_ignore :
arch_register_req_type_none;
be_make_start_out(&start_val[i], obst, start, o++, &ia32_registers[i], flags);
be_make_start_out(&start_val[i], start, o++, &ia32_registers[i], flags);
}
assert(n_outs == o);
......
......@@ -1563,7 +1563,6 @@ static ir_node *gen_Start(ir_node *node)
ir_type *function_type = get_entity_type(entity);
ir_node *new_block = be_transform_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
struct obstack *obst = be_get_be_obst(irg);
/* start building list of start constraints */
......@@ -1586,16 +1585,16 @@ static ir_node *gen_Start(ir_node *node)
be_make_start_mem(&start_mem, start, o++);
/* the zero register */
be_make_start_out(&start_g0, obst, start, o++, &sparc_registers[REG_G0], arch_register_req_type_ignore);
be_make_start_out(&start_g0, start, o++, &sparc_registers[REG_G0], arch_register_req_type_ignore);
/* g7 is used for TLS data */
be_make_start_out(&start_g7, obst, start, o++, &sparc_registers[REG_G7], arch_register_req_type_ignore);
be_make_start_out(&start_g7, start, o++, &sparc_registers[REG_G7], arch_register_req_type_ignore);
/* we need an output for the stack pointer */
be_make_start_out(&start_sp, obst, start, o++, sp_reg, arch_register_req_type_ignore | arch_register_req_type_produces_sp);
be_make_start_out(&start_sp, start, o++, sp_reg, arch_register_req_type_ignore | arch_register_req_type_produces_sp);
if (!current_cconv->omit_fp) {
be_make_start_out(&start_fp, obst, start, o++, fp_reg, arch_register_req_type_ignore);
be_make_start_out(&start_fp, start, o++, fp_reg, arch_register_req_type_ignore);
}
/* function parameters in registers */
......
Supports Markdown
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