projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed addressmode
[libfirm]
/
ir
/
be
/
beabi.c
diff --git
a/ir/be/beabi.c
b/ir/be/beabi.c
index
0dc7770
..
87b4315
100644
(file)
--- a/
ir/be/beabi.c
+++ b/
ir/be/beabi.c
@@
-74,7
+74,6
@@
struct _be_stack_slot_t {
struct _be_abi_irg_t {
struct obstack obst;
struct _be_abi_irg_t {
struct obstack obst;
- firm_dbg_module_t *dbg; /**< The debugging module. */
be_stack_frame_t *frame; /**< The stack frame model. */
const be_irg_t *birg; /**< The back end IRG. */
const arch_isa_t *isa; /**< The isa. */
be_stack_frame_t *frame; /**< The stack frame model. */
const be_irg_t *birg; /**< The back end IRG. */
const arch_isa_t *isa; /**< The isa. */
@@
-99,6
+98,7
@@
struct _be_abi_irg_t {
arch_irn_handler_t irn_handler;
arch_irn_ops_t irn_ops;
arch_irn_handler_t irn_handler;
arch_irn_ops_t irn_ops;
+ DEBUG_ONLY(firm_dbg_module_t *dbg;) /**< The debugging module. */
};
#define get_abi_from_handler(ptr) firm_container_of(ptr, be_abi_irg_t, irn_handler)
};
#define get_abi_from_handler(ptr) firm_container_of(ptr, be_abi_irg_t, irn_handler)
@@
-1101,7
+1101,7
@@
static void create_barrier(be_abi_irg_t *env, ir_node *bl, ir_node **mem, pmap *
}
in = (ir_node **) obstack_finish(&env->obst);
}
in = (ir_node **) obstack_finish(&env->obst);
- irn = be_new_Barrier(
env->birg->
irg, bl, n, in);
+ irn = be_new_Barrier(irg, bl, n, in);
obstack_free(&env->obst, in);
for(n = 0; n < n_regs; ++n) {
obstack_free(&env->obst, in);
for(n = 0; n < n_regs; ++n) {
@@
-1109,7
+1109,7
@@
static void create_barrier(be_abi_irg_t *env, ir_node *bl, ir_node **mem, pmap *
ir_node *proj;
const arch_register_t *reg = rm[n].reg;
ir_node *proj;
const arch_register_t *reg = rm[n].reg;
- proj = new_r_Proj(
env->birg->
irg, bl, irn, get_irn_mode(rm[n].irn), n);
+ proj = new_r_Proj(irg, bl, irn, get_irn_mode(rm[n].irn), n);
be_node_set_reg_class(irn, n, reg->reg_class);
if(in_req)
be_set_constr_single_reg(irn, n, reg);
be_node_set_reg_class(irn, n, reg->reg_class);
if(in_req)
be_set_constr_single_reg(irn, n, reg);
@@
-1123,7
+1123,7
@@
static void create_barrier(be_abi_irg_t *env, ir_node *bl, ir_node **mem, pmap *
}
if(mem) {
}
if(mem) {
- *mem = new_r_Proj(
env->birg->
irg, bl, irn, mode_M, n);
+ *mem = new_r_Proj(irg, bl, irn, mode_M, n);
}
obstack_free(&env->obst, rm);
}
obstack_free(&env->obst, rm);
@@
-1134,7
+1134,6
@@
static void create_barrier(be_abi_irg_t *env, ir_node *bl, ir_node **mem, pmap *
*/
static void modify_irg(be_abi_irg_t *env)
{
*/
static void modify_irg(be_abi_irg_t *env)
{
- firm_dbg_module_t *dbg = env->dbg;
be_abi_call_t *call = env->call;
const arch_isa_t *isa = env->birg->main_env->arch_env->isa;
const arch_register_t *sp = arch_isa_sp(isa);
be_abi_call_t *call = env->call;
const arch_isa_t *isa = env->birg->main_env->arch_env->isa;
const arch_register_t *sp = arch_isa_sp(isa);
@@
-1146,10
+1145,9
@@
static void modify_irg(be_abi_irg_t *env)
ir_node *mem = get_irg_initial_mem(irg);
type *method_type = get_entity_type(get_irg_entity(irg));
pset *dont_save = pset_new_ptr(8);
ir_node *mem = get_irg_initial_mem(irg);
type *method_type = get_entity_type(get_irg_entity(irg));
pset *dont_save = pset_new_ptr(8);
- pmap *reg_proj_map = pmap_create();
int n_params = get_method_n_params(method_type);
int max_arg = 0;
int n_params = get_method_n_params(method_type);
int max_arg = 0;
- int arg_offset = 0;
+ DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;)
int i, j, n;
int i, j, n;
@@
-1178,10
+1176,11
@@
static void modify_irg(be_abi_irg_t *env)
int nr = get_Proj_proj(irn);
max_arg = MAX(max_arg, nr);
}
int nr = get_Proj_proj(irn);
max_arg = MAX(max_arg, nr);
}
- max_arg = MAX(max_arg + 1, n_params);
- args = obstack_alloc(&env->obst, max_arg * sizeof(args[0]));
- memset(args, 0, max_arg * sizeof(args[0]));
+
used_proj_nr = bitset_alloca(1024);
used_proj_nr = bitset_alloca(1024);
+ max_arg = MAX(max_arg + 1, n_params);
+ args = obstack_alloc(&env->obst, max_arg * sizeof(args[0]));
+ memset(args, 0, max_arg * sizeof(args[0]));
/* Fill the argument vector */
foreach_out_edge(arg_tuple, edge) {
/* Fill the argument vector */
foreach_out_edge(arg_tuple, edge) {
@@
-1480,6
+1479,9
@@
void be_abi_free(be_abi_irg_t *env)
*/
*/
+/**
+ * Walker. Collect all stack modifying nodes.
+ */
static void collect_stack_nodes_walker(ir_node *irn, void *data)
{
pset *s = data;
static void collect_stack_nodes_walker(ir_node *irn, void *data)
{
pset *s = data;
@@
-1522,9
+1524,8
@@
static int get_dir(ir_node *irn)
static int process_stack_bias(be_abi_irg_t *env, ir_node *bl, int bias)
{
const arch_env_t *aenv = env->birg->main_env->arch_env;
static int process_stack_bias(be_abi_irg_t *env, ir_node *bl, int bias)
{
const arch_env_t *aenv = env->birg->main_env->arch_env;
+ int omit_fp = env->call->flags.bits.try_omit_fp;
ir_node *irn;
ir_node *irn;
- int start_bias = bias;
- int omit_fp = env->call->flags.bits.try_omit_fp;
sched_foreach(bl, irn) {
sched_foreach(bl, irn) {