Commit de3a2dd3 authored by Christian Würdig's avatar Christian Würdig
Browse files

added new callback to set frame entity

parent 0b549402
......@@ -210,6 +210,10 @@ static entity *TEMPLATE_get_frame_entity(const void *self, const ir_node *irn) {
return NULL;
}
static void TEMPLATE_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
/* TODO: set the entity assigned to the frame */
}
/**
* This function is called by the generic backend to correct offsets for
* nodes accessing the stack.
......@@ -227,7 +231,12 @@ static const arch_irn_ops_if_t TEMPLATE_irn_ops_if = {
TEMPLATE_classify,
TEMPLATE_get_flags,
TEMPLATE_get_frame_entity,
TEMPLATE_set_frame_entity,
TEMPLATE_set_stack_bias
NULL, /* get_inverse */
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
TEMPLATE_irn_ops_t TEMPLATE_irn_ops = {
......
......@@ -103,7 +103,7 @@ static const char *node_offset_to_str(ir_node *n, char *buf, int buflen) {
entity *ent = be_get_frame_entity(n);
offset = get_entity_offset_bytes(ent);
} else if (irn_op == op_be_Reload || irn_op == op_be_Spill) {
entity * ent = be_get_spill_entity(n);
entity *ent = be_get_frame_entity(n);
offset = get_entity_offset_bytes(ent);
} else if (irn_op == op_be_IncSP) {
int offs = be_get_IncSP_offset(n);
......
......@@ -231,6 +231,10 @@ static entity *arm_get_frame_entity(const void *self, const ir_node *irn) {
return NULL;
}
static void arm_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
/* TODO: set the entity assigned to the frame */
}
/**
* This function is called by the generic backend to correct offsets for
* nodes accessing the stack.
......@@ -248,8 +252,12 @@ static const arch_irn_ops_if_t arm_irn_ops_if = {
arm_classify,
arm_get_flags,
arm_get_frame_entity,
arm_set_frame_entity,
arm_set_stack_bias,
NULL
NULL, /* get_inverse */
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
arm_irn_ops_t arm_irn_ops = {
......
......@@ -362,6 +362,10 @@ static entity *firm_get_frame_entity(const void *self, const ir_node *irn)
return NULL;
}
static void firm_set_frame_entity(const void *self, const ir_node *irn, entity *ent)
{
}
static const arch_irn_ops_if_t firm_irn_ops_if = {
firm_get_irn_reg_req,
firm_set_irn_reg,
......@@ -369,7 +373,12 @@ static const arch_irn_ops_if_t firm_irn_ops_if = {
firm_classify,
firm_get_flags,
firm_get_frame_entity,
firm_set_stack_bias
firm_set_frame_entity,
firm_set_stack_bias,
NULL, /* get_inverse */
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
static const arch_irn_ops_t firm_irn_ops = {
......
......@@ -237,6 +237,12 @@ static entity *mips_get_frame_entity(const void *self, const ir_node *irn) {
return NULL;
}
static void mips_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
mips_attr_t *attr = get_mips_attr(irn);
assert(is_mips_load_r(irn) || is_mips_store_r(irn));
attr->stack_entity = ent;
}
/**
* This function is called by the generic backend to correct offsets for
* nodes accessing the stack.
......@@ -257,8 +263,12 @@ static const arch_irn_ops_if_t mips_irn_ops_if = {
mips_classify,
mips_get_flags,
mips_get_frame_entity,
mips_set_frame_entity,
mips_set_frame_offset,
NULL
NULL, /* get_inverse */
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
mips_irn_ops_t mips_irn_ops = {
......
......@@ -130,7 +130,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set)
// test all nodes in the ready set and take the first non-branch that
// is allowed
for (node = nodeset_first(ready_set); node != NULL; node = nodeset_next(ready_set)) {
if (arch_irn_classify(arch_env, node) == arch_irn_class_branch) {
if (arch_irn_class_is(arch_env, node, branch)) {
if (is_irn_forking(node))
condjmp = node;
continue;
......@@ -163,7 +163,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set)
return condjmp;
}
node = nodeset_first(ready_set);
assert(arch_irn_classify(arch_env, node) == arch_irn_class_branch);
assert(arch_irn_class_is(arch_env, node, branch));
nodeset_break(ready_set);
return node;
}
......
......@@ -233,6 +233,12 @@ static entity *ppc32_get_frame_entity(const void *self, const ir_node *irn) {
return get_ppc32_frame_entity(irn);
}
static void ppc32_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
if (! is_ppc32_irn(irn) || get_ppc32_type(irn) != ppc32_ac_FrameEntity)
return;
set_ppc32_frame_entity(irn, ent);
}
/**
* This function is called by the generic backend to correct offsets for
* nodes accessing the stack.
......@@ -359,8 +365,12 @@ static const arch_irn_ops_if_t ppc32_irn_ops_if = {
ppc32_classify,
ppc32_get_flags,
ppc32_get_frame_entity,
ppc32_set_frame_entity,
ppc32_set_stack_bias,
NULL
NULL, /* get_inverse */
NULL, /* get_op_estimated_cost */
NULL, /* possible_memory_operand */
NULL, /* perform_memory_operand */
};
ppc32_irn_ops_t ppc32_irn_ops = {
......
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