created anchor for the value base pointer
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Jun 2006 02:38:54 +0000 (02:38 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Jun 2006 02:38:54 +0000 (02:38 +0000)
get_irg_value_param_base() & set_irg_value_param_base() added

[r7887]

ir/ir/irgraph.c
ir/ir/irgraph.h
ir/ir/irgraph_t.h

index c91e41a..71088ac 100644 (file)
@@ -224,12 +224,13 @@ new_r_ir_graph (entity *ent, int n_loc)
   set_irg_start      (res, start);
 
   /* Proj results of start node */
-  projX              = new_Proj(start, mode_X, pn_Start_X_initial_exec);
-  set_irg_frame      (res, new_Proj(start, mode_P_data, pn_Start_P_frame_base));
-  set_irg_globals    (res, new_Proj(start, mode_P_data, pn_Start_P_globals));
-  set_irg_tls        (res, new_Proj(start, mode_P_data, pn_Start_P_tls));
-  set_irg_args       (res, new_Proj(start, mode_T, pn_Start_T_args));
-  initial_mem        = new_Proj(start, mode_M, pn_Start_M);
+  projX                   = new_Proj(start, mode_X, pn_Start_X_initial_exec);
+  set_irg_frame           (res, new_Proj(start, mode_P_data, pn_Start_P_frame_base));
+  set_irg_globals         (res, new_Proj(start, mode_P_data, pn_Start_P_globals));
+  set_irg_tls             (res, new_Proj(start, mode_P_data, pn_Start_P_tls));
+  set_irg_args            (res, new_Proj(start, mode_T,      pn_Start_T_args));
+  set_irg_value_param_base(res, new_Proj(start, mode_P_data, pn_Start_P_value_arg_base));
+  initial_mem             = new_Proj(start, mode_M, pn_Start_M);
   set_irg_initial_mem(res, initial_mem);
 
   add_immBlock_pred(start_block, projX);
@@ -509,6 +510,16 @@ void
   _set_irg_args(irg, node);
 }
 
+ir_node *
+(get_irg_value_param_base)(const ir_graph *irg) {
+  return _get_irg_value_param_base(irg);
+}
+
+void
+(set_irg_value_param_base)(ir_graph *irg, ir_node *node) {
+  _set_irg_value_param_base(irg, node);
+}
+
 ir_node **
 (get_irg_proj_args) (const ir_graph *irg) {
   return _get_irg_proj_args (irg);
index 115dc9f..3485e22 100644 (file)
@@ -239,6 +239,11 @@ ir_node *get_irg_args (const ir_graph *irg);
 /** Sets the node that represents the argument pointer. */
 void     set_irg_args (ir_graph *irg, ir_node *node);
 
+/** Returns the node that represents the value parameter base pointer. */
+ir_node *get_irg_value_param_base (const ir_graph *irg);
+/** Sets the node that represents the value parameter base pointer. */
+void     set_irg_value_param_base (ir_graph *irg, ir_node *node);
+
 /** Returns an array of the nodes of the argument pointer. */
 ir_node **get_irg_proj_args (const ir_graph *irg);
 /** Sets the array of the nodes of the argument pointer. */
index 04fd734..9b2dd1a 100644 (file)
@@ -55,22 +55,23 @@ typedef struct _irg_edge_info_t {
  * Index constants for nodes that can be accessed through the graph itself.
  */
 enum irg_anchors {
-  anchor_start_block = 0, /**< block the start node will belong to */
-  anchor_start,           /**< start node of this ir_graph */
-  anchor_end_block,       /**< block the end node will belong to */
-  anchor_end,             /**< end node of this ir_graph */
-  anchor_end_reg,         /**< end node of this ir_graph */
-  anchor_end_except,      /**< end node of this ir_graph */
-  anchor_frame,           /**< method's frame */
-  anchor_globals,         /**< pointer to the data segment containing all
-                               globals as well as global procedures. */
-  anchor_tls,             /**< pointer to the thread local storage containing all
-                               thread local data. */
-  anchor_initial_mem,     /**< initial memory of this graph */
-  anchor_args,            /**< methods arguments */
-  anchor_bad,             /**< bad node of this ir_graph, the one and
-                               only in this graph */
-  anchor_no_mem,          /**< NoMem node of this ir_graph, the one and only in this graph */
+  anchor_start_block = 0,  /**< block the start node will belong to */
+  anchor_start,            /**< start node of this ir_graph */
+  anchor_end_block,        /**< block the end node will belong to */
+  anchor_end,              /**< end node of this ir_graph */
+  anchor_end_reg,          /**< end node of this ir_graph */
+  anchor_end_except,       /**< end node of this ir_graph */
+  anchor_frame,            /**< method's frame */
+  anchor_globals,          /**< pointer to the data segment containing all
+                                globals as well as global procedures. */
+  anchor_tls,              /**< pointer to the thread local storage containing all
+                                thread local data. */
+  anchor_initial_mem,      /**< initial memory of this graph */
+  anchor_args,             /**< methods arguments */
+  anchor_value_param_base, /**< method value param base */
+  anchor_bad,              /**< bad node of this ir_graph, the one and
+                                only in this graph */
+  anchor_no_mem,           /**< NoMem node of this ir_graph, the one and only in this graph */
   anchor_max
 };
 
@@ -303,6 +304,16 @@ _set_irg_args(ir_graph *irg, ir_node *node) {
   irg->anchors[anchor_args] = node;
 }
 
+static INLINE ir_node *
+_get_irg_value_param_base(const ir_graph *irg) {
+  return irg->anchors[anchor_value_param_base];
+}
+
+static INLINE void
+_set_irg_value_param_base(ir_graph *irg, ir_node *node) {
+  irg->anchors[anchor_value_param_base] = node;
+}
+
 static INLINE ir_node **
 _get_irg_proj_args(const ir_graph *irg) {
   return irg->proj_args;
@@ -601,6 +612,8 @@ get_idx_irn(ir_graph *irg, unsigned idx) {
 #define set_irg_initial_mem(irg, node)        _set_irg_initial_mem(irg, node)
 #define get_irg_args(irg)                     _get_irg_args(irg)
 #define set_irg_args(irg, node)               _set_irg_args(irg, node)
+#define get_irg_value_param_base(irg)         _get_irg_value_param_base(irg)
+#define set_irg_value_param_base(irg, node)   _set_irg_value_param_base(irg, node)
 #define get_irg_bad(irg)                      _get_irg_bad(irg)
 #define set_irg_bad(irg, node)                _set_irg_bad(irg, node)
 #define get_irg_no_mem(irg)                   _get_irg_no_mem(irg)