if (dependent_on(n2, n1))
return 1;
- return 0;
+ /* The nodes have no depth order, but we need a total order because qsort()
+ * is not stable. */
+ return get_irn_idx(n1) - get_irn_idx(n2);
}
/**
ir_node *bl = get_nodes_block(irn);
ir_node *nw;
int pos = 0;
+ int is_value_param = 0;
if (get_entity_owner(ent) == ctx->value_tp) {
+ is_value_param = 1;
+
/* replace by its copy from the argument type */
pos = get_struct_member_index(ctx->value_tp, ent);
ent = get_argument_entity(ent, ctx);
nw = be_new_FrameAddr(ctx->sp_class, current_ir_graph, bl, ctx->frame, ent);
exchange(irn, nw);
- /* check, if it's a param sel and if have not seen this entity before */
- if (get_entity_owner(ent) == ctx->value_tp && get_entity_link(ent) == NULL) {
+ /* check, if it's a param Sel and if have not seen this entity before */
+ if (is_value_param && get_entity_link(ent) == NULL) {
ent_pos_pair pair;
pair.ent = ent;
/**
* Fix access to outer local variables.
*/
-static void fix_outer_variable_access(be_abi_irg_t *env, lower_frame_sels_env_t *ctx)
+static void fix_outer_variable_access(be_abi_irg_t *env,
+ lower_frame_sels_env_t *ctx)
{
int i;
ir_graph *irg;
+ (void) env;
for (i = get_class_n_members(ctx->frame_tp) - 1; i >= 0; --i) {
ir_entity *ent = get_class_member(ctx->frame_tp, i);
if (! is_method_entity(ent))
continue;
+ if (get_entity_peculiarity(ent) == peculiarity_description)
+ continue;
/*
* FIXME: find the number of the static link parameter
static int can_address_relative(ir_entity *entity)
{
return get_entity_variability(entity) == variability_initialized
- || get_entity_visibility(entity) == visibility_local;
+ && get_entity_visibility(entity) != visibility_external_allocated;
}
/** patches SymConsts to work in position independent code */
for (i = get_class_n_members(frame_tp) - 1; i >= 0; --i) {
ir_entity *ent = get_class_member(frame_tp, i);
- if (is_method_entity(ent)) {
+ if (is_method_entity(ent) && get_entity_peculiarity(ent) != peculiarity_description) {
ir_graph *irg = get_entity_irg(ent);
irg_walk_graph(irg, NULL, lower_outer_frame_sels, env);