From d6b7e949a935d6f5a41494982360017651d691cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Fri, 11 Aug 2006 14:19:42 +0000 Subject: [PATCH] added new callback to set frame entity --- ir/be/beabi.c | 11 ++++++++++- ir/be/bearch.c | 6 ++++++ ir/be/bearch.h | 9 +++++++++ ir/be/benode.c | 23 +++++++++++++++++++++-- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/ir/be/beabi.c b/ir/be/beabi.c index fcb5ad9f8..d326f64a7 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -1992,6 +1992,10 @@ static entity *abi_get_frame_entity(const void *_self, const ir_node *irn) return NULL; } +static void abi_set_frame_entity(const void *_self, const ir_node *irn, entity *ent) +{ +} + static void abi_set_stack_bias(const void *_self, ir_node *irn, int bias) { } @@ -2003,7 +2007,12 @@ static const arch_irn_ops_if_t abi_irn_ops = { abi_classify, abi_get_flags, abi_get_frame_entity, - abi_set_stack_bias + abi_set_frame_entity, + abi_set_stack_bias, + NULL, /* get_inverse */ + NULL, /* get_op_estimated_cost */ + NULL, /* possible_memory_operand */ + NULL, /* perform_memory_operand */ }; static const arch_irn_handler_t abi_irn_handler = { diff --git a/ir/be/bearch.c b/ir/be/bearch.c index 23f023f6e..f25d0dfd3 100644 --- a/ir/be/bearch.c +++ b/ir/be/bearch.c @@ -107,6 +107,12 @@ entity *arch_get_frame_entity(const arch_env_t *env, ir_node *irn) return ops->impl->get_frame_entity(ops, irn); } +void arch_set_frame_entity(const arch_env_t *env, ir_node *irn, entity *ent) +{ + const arch_irn_ops_t *ops = get_irn_ops(env, irn); + ops->impl->set_frame_entity(ops, irn, ent); +} + arch_inverse_t *arch_get_inverse(const arch_env_t *env, const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack) { const arch_irn_ops_t *ops = get_irn_ops(env, irn); diff --git a/ir/be/bearch.h b/ir/be/bearch.h index e98860670..2f5369f25 100644 --- a/ir/be/bearch.h +++ b/ir/be/bearch.h @@ -280,6 +280,14 @@ struct _arch_irn_ops_if_t { */ entity *(*get_frame_entity)(const void *self, const ir_node *irn); + /** + * Set the entity on the stack frame this node depends on. + * @param self The this pointer. + * @param irn The node in question. + * @param ent The entity to set + */ + void (*set_frame_entity)(const void *self, const ir_node *irn, entity *ent); + /** * Set the offset of a node carrying an entity on the stack frame. * @param self The this pointer. @@ -343,6 +351,7 @@ struct _arch_irn_ops_t { extern void arch_set_frame_offset(const arch_env_t *env, ir_node *irn, int bias); extern entity *arch_get_frame_entity(const arch_env_t *env, ir_node *irn); +extern void arch_set_frame_entity(const arch_env_t *env, ir_node *irn, entity *ent); extern int arch_get_op_estimated_cost(const arch_env_t *env, const ir_node *irn); extern arch_inverse_t *arch_get_inverse(const arch_env_t *env, const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack); diff --git a/ir/be/benode.c b/ir/be/benode.c index 95416e7d8..a7f13d6c2 100644 --- a/ir/be/benode.c +++ b/ir/be/benode.c @@ -1082,6 +1082,11 @@ static entity *be_node_get_frame_entity(const void *self, const ir_node *irn) return be_get_frame_entity(irn); } +static void be_node_set_frame_entity(const void *self, const ir_node *irn, entity *ent) +{ + be_set_frame_entity(irn, ent); +} + static void be_node_set_frame_offset(const void *self, ir_node *irn, int offset) { if(be_has_frame_entity(irn)) { @@ -1106,7 +1111,12 @@ static const arch_irn_ops_if_t be_node_irn_ops_if = { be_node_classify, be_node_get_flags, be_node_get_frame_entity, - be_node_set_frame_offset + be_node_set_frame_entity, + be_node_set_frame_offset, + NULL, /* get_inverse */ + NULL, /* get_op_estimated_cost */ + NULL, /* possible_memory_operand */ + NULL, /* perform_memory_operand */ }; static const arch_irn_ops_t be_node_irn_ops = { @@ -1226,6 +1236,10 @@ static entity *phi_get_frame_entity(const void *_self, const ir_node *irn) return NULL; } +static void phi_set_frame_entity(const void *_self, const ir_node *irn, entity *ent) +{ +} + static void phi_set_frame_offset(const void *_self, ir_node *irn, int bias) { } @@ -1237,7 +1251,12 @@ static const arch_irn_ops_if_t phi_irn_ops = { phi_classify, phi_get_flags, phi_get_frame_entity, - phi_set_frame_offset + phi_set_frame_entity, + phi_set_frame_offset, + NULL, /* get_inverse */ + NULL, /* get_op_estimated_cost */ + NULL, /* possible_memory_operand */ + NULL, /* perform_memory_operand */ }; static const arch_irn_handler_t phi_irn_handler = { -- 2.20.1