Access to value_type entities is now given by the frame pointer.
[r25246]
/** Sets the node that represents the argument pointer of the given IR graph. */
void set_irg_args(ir_graph *irg, ir_node *node);
-/** Returns the node that represents the value parameter base pointer of the given IR graph. */
-ir_node *get_irg_value_param_base(const ir_graph *irg);
-/** Sets the node that represents the value parameter base pointer of the given IR graph. */
-void set_irg_value_param_base(ir_graph *irg, ir_node *node);
-
/** Returns the current block of an IR graph. */
ir_node *get_irg_current_block(const ir_graph *irg);
/** Sets the current block of an IR graph. */
pn_Start_P_tls, /**< Projection on the pointer to the thread local store
segment containing _all_thread local variables. */
pn_Start_T_args, /**< Projection on all arguments. */
- pn_Start_P_value_arg_base, /**< Pointer to region of compound value arguments as defined by
- type of this method. */
pn_Start_max /**< number of projections from a Start */
} pn_Start; /* Projection numbers for Start. */
* from Start. If so returns tls type, else Null. */
ir_type *is_tls_pointer(const ir_node *n);
-/** Test whether arbitrary node is value arg base.
- *
- * Test whether arbitrary node is value arg base, i.e. Proj(pn_Start_P_value_arg_base)
- * from Start. If so returns 1, else 0. */
-int is_value_arg_pointer(const ir_node *n);
-
/* @@@ no more supported */
ir_node **get_Block_cfgpred_arr(ir_node *node);
int get_Block_n_cfgpreds(const ir_node *node);
case pn_Start_P_tls:
tp = find_pointer_type_to(get_tls_type());
break;
- case pn_Start_P_value_arg_base:
- DB((dbg, SET_LEVEL_1, "Value arg base proj %ld from Start: unknown type\n", get_irn_node_nr(n)));
- tp = firm_unknown_type; /* find_pointer_type_to(get....(get_entity_type(get_irg_entity(get_irn_irg(pred))))); */
- break;
default:
DB((dbg, SET_LEVEL_1, "Proj %ld %ld from Start: unknown type\n", get_Proj_proj(n), get_irn_node_nr(n)));
tp = firm_unknown_type;
typedef struct lower_frame_sels_env_t {
ent_pos_pair *value_param_list; /**< the list of all value param entities */
ir_node *frame; /**< the current frame */
- ir_node *param_base; /**< the current value parameter base */
const arch_register_class_t *sp_class; /**< register class of the stack pointer */
ir_type *value_tp; /**< the value type if any */
ir_type *frame_tp; /**< the frame type */
if (is_Sel(irn)) {
ir_node *ptr = get_Sel_ptr(irn);
- if (ptr == ctx->frame || ptr == ctx->param_base) {
+ if (ptr == ctx->frame) {
ir_entity *ent = get_Sel_entity(irn);
ir_node *bl = get_nodes_block(irn);
ir_node *nw;
ir_node *reg_params_bl;
ir_node **args;
ir_node *arg_tuple;
- ir_node *value_param_base;
const ir_edge_t *edge;
ir_type *arg_type, *bet_type, *tp;
lower_frame_sels_env_t ctx;
/* Convert the Sel nodes in the irg to frame addr nodes: */
ctx.value_param_list = NEW_ARR_F(ent_pos_pair, 0);
ctx.frame = get_irg_frame(irg);
- ctx.param_base = get_irg_value_param_base(irg);
ctx.sp_class = env->arch_env->sp->reg_class;
ctx.frame_tp = get_irg_frame_type(irg);
/* fix the frame type layout again */
set_type_state(ctx.frame_tp, layout_fixed);
- /* value_param_base anchor is not needed anymore now */
- value_param_base = get_irg_value_param_base(irg);
- kill_node(value_param_base);
- set_irg_value_param_base(irg, new_r_Bad(irg));
-
env->regs = pmap_create();
n_params = get_method_n_params(method_type);
X(P_frame_base),
X(P_tls),
X(T_args),
- X(P_value_arg_base)
#undef X
};
set_irg_frame (res, new_Proj(start, mode_P_data, pn_Start_P_frame_base));
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);
_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_bad)(const ir_graph *irg) {
return _get_irg_bad(irg);
set_irn_n(irg->anchor, anchor_args, node);
}
-static inline ir_node *
-_get_irg_value_param_base(const ir_graph *irg) {
- return get_irn_intra_n(irg->anchor, anchor_value_param_base);
-}
-
-static inline void
-_set_irg_value_param_base(ir_graph *irg, ir_node *node) {
- set_irn_n(irg->anchor, anchor_value_param_base, node);
-}
-
static inline ir_node *
_get_irg_bad(const ir_graph *irg) {
return get_irn_intra_n(irg->anchor, anchor_bad);
#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)
return NULL;
}
-/* Test whether arbitrary node is value arg base, i.e. Proj(pn_Start_P_value_arg_base)
- * from Start. If so returns 1, else 0. */
-int is_value_arg_pointer(const ir_node *n) {
- if (is_Proj(n) &&
- (get_Proj_proj(n) == pn_Start_P_value_arg_base) &&
- is_Start(get_Proj_pred(n)))
- return 1;
- return 0;
-}
-
/* Returns an array with the predecessors of the Block. Depending on
the implementation of the graph data structure this can be a copy of
the internal representation of predecessors as well as the internal
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 */
(proj == pn_Start_M && mode == mode_M) ||
(proj == pn_Start_P_frame_base && mode_is_reference(mode)) ||
(proj == pn_Start_P_tls && mode_is_reference(mode)) ||
- (proj == pn_Start_T_args && mode == mode_T) ||
- (proj == pn_Start_P_value_arg_base && mode_is_reference(mode)) ||
- (proj == pn_Start_P_value_arg_base && mode == mode_T) /* FIXME: only one of those */
+ (proj == pn_Start_T_args && mode == mode_T)
),
"wrong Proj from Start", 0,
show_proj_failure(p);
show_proj_mode_failure(p, get_method_param_type(mt, proj));
);
}
- } else if (nr == pn_Start_P_value_arg_base) {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_reference(mode)),
- "wrong Proj from Proj from Start", 0
- );
- ASSERT_AND_RET(
- (proj < get_method_n_params(mt)),
- "More Projs for args than args in type", 0
- );
}
break;
*/
static void find_addr(ir_node *node, void *env) {
int *allow_inline = env;
- if (is_Proj(node) &&
- is_Start(get_Proj_pred(node)) &&
- get_Proj_proj(node) == pn_Start_P_value_arg_base) {
- *allow_inline = 0;
+ if (is_Sel(node)) {
+ ir_graph *irg = current_ir_graph;
+ if (get_Sel_ptr(node) == get_irg_frame(irg)) {
+ /* access to frame */
+ ir_entity *ent = get_Sel_entity(node);
+ if (get_entity_owner(ent) != get_irg_frame_type(irg)) {
+ /* access to value_type */
+ *allow_inline = 0;
+ }
+ }
} else if (is_Alloc(node) && get_Alloc_where(node) == stack_alloc) {
/* From GCC:
* Refuse to inline alloca call unless user explicitly forced so as this
in[pn_Start_P_frame_base] = get_irg_frame(irg);
in[pn_Start_P_tls] = get_irg_tls(irg);
in[pn_Start_T_args] = new_Tuple(n_params, args_in);
- /* in[pn_Start_P_value_arg_base] = ??? */
- assert(pn_Start_P_value_arg_base == pn_Start_max - 1 && "pn_Start_P_value_arg_base not supported, fix");
- pre_call = new_Tuple(pn_Start_max - 1, in);
+ pre_call = new_Tuple(pn_Start_max, in);
post_call = call;
/* --
* @return non-zero if it's ok to do tail recursion
*/
static int check_lifetime_of_locals(ir_graph *irg) {
- ir_node *irg_frame, *irg_val_param_base;
+ ir_node *irg_frame;
int i;
ir_type *frame_tp = get_irg_frame_type(irg);
for (i = get_irn_n_outs(irg_frame) - 1; i >= 0; --i) {
ir_node *succ = get_irn_out(irg_frame, i);
- /* we are only interested in entities on the frame type
- * (locals), not on the value type */
- if (get_entity_owner(get_Sel_entity(succ)) != frame_tp)
- continue;
+ if (is_Sel(succ)) {
+ /* Check if we have compound arguments.
+ For now, we cannot handle them, */
+ if (get_entity_owner(get_Sel_entity(succ)) != frame_tp)
+ return 0;
- if (is_Sel(succ) && is_address_taken(succ))
- return 0;
+ if (is_address_taken(succ))
+ return 0;
+ }
}
-
- /* Check if we have compound arguments.
- For now, we cannot handle them, */
- irg_val_param_base = get_irg_value_param_base(irg);
- if (get_irn_n_outs(irg_val_param_base) > 0)
- return 0;
-
return 1;
}