From: Christian Würdig Date: Fri, 11 Aug 2006 14:20:19 +0000 (+0000) Subject: added new callback to set frame entity X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=de3a2dd34bde1c1128f6afb0643b8fac13d38d76;p=libfirm added new callback to set frame entity --- diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index d7fa82cde..219f159c6 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -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 = { diff --git a/ir/be/arm/arm_emitter.c b/ir/be/arm/arm_emitter.c index 988a160d6..64dc9d281 100644 --- a/ir/be/arm/arm_emitter.c +++ b/ir/be/arm/arm_emitter.c @@ -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); diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index e2c18892a..d7d3bd533 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -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 = { diff --git a/ir/be/firm/bearch_firm.c b/ir/be/firm/bearch_firm.c index 42af2934e..1813af79b 100644 --- a/ir/be/firm/bearch_firm.c +++ b/ir/be/firm/bearch_firm.c @@ -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 = { diff --git a/ir/be/mips/bearch_mips.c b/ir/be/mips/bearch_mips.c index 78196241f..105f6b1fa 100644 --- a/ir/be/mips/bearch_mips.c +++ b/ir/be/mips/bearch_mips.c @@ -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 = { diff --git a/ir/be/mips/mips_scheduler.c b/ir/be/mips/mips_scheduler.c index fdbb59ed0..99974198c 100644 --- a/ir/be/mips/mips_scheduler.c +++ b/ir/be/mips/mips_scheduler.c @@ -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; } diff --git a/ir/be/ppc32/bearch_ppc32.c b/ir/be/ppc32/bearch_ppc32.c index c1222d6e1..455f3710e 100644 --- a/ir/be/ppc32/bearch_ppc32.c +++ b/ir/be/ppc32/bearch_ppc32.c @@ -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 = {