added new callback to set frame entity
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Fri, 11 Aug 2006 14:19:42 +0000 (14:19 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Fri, 11 Aug 2006 14:19:42 +0000 (14:19 +0000)
ir/be/beabi.c
ir/be/bearch.c
ir/be/bearch.h
ir/be/benode.c

index fcb5ad9..d326f64 100644 (file)
@@ -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 = {
index 23f023f..f25d0df 100644 (file)
@@ -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);
index e988606..2f5369f 100644 (file)
@@ -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);
index 95416e7..a7f13d6 100644 (file)
@@ -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 = {