From 9cd642970863a2f240a110f933c9256fc6cbd757 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 8 Jun 2006 02:38:54 +0000 Subject: [PATCH] created anchor for the value base pointer get_irg_value_param_base() & set_irg_value_param_base() added [r7887] --- ir/ir/irgraph.c | 23 +++++++++++++++++------ ir/ir/irgraph.h | 5 +++++ ir/ir/irgraph_t.h | 45 +++++++++++++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index c91e41ae7..71088acc2 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -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); diff --git a/ir/ir/irgraph.h b/ir/ir/irgraph.h index 115dc9ff9..3485e22c6 100644 --- a/ir/ir/irgraph.h +++ b/ir/ir/irgraph.h @@ -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. */ diff --git a/ir/ir/irgraph_t.h b/ir/ir/irgraph_t.h index 04fd7345b..9b2dd1aa3 100644 --- a/ir/ir/irgraph_t.h +++ b/ir/ir/irgraph_t.h @@ -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) -- 2.20.1