+2014-08-27 David Malcolm <dmalcolm@redhat.com>
+
+ * function.h (struct expr_status): Strengthen field
+ "x_forced_labels" from rtx to rtx_expr_list *.
+
+ * cfgbuild.c (make_edges): Split local "x" into two locals,
+ strengthening one from rtx to rtx_expr_list *, and using methods
+ of said class.
+ * dwarf2cfi.c (create_trace_edges): Split local "lab" out; within
+ loop over forced_labels, introduce strengthen it from rtx to
+ rtx_expr_list *, using methods to clarify the code.
+ * jump.c (rebuild_jump_labels_1): Strengthen local "insn" from rtx
+ to rtx_expr_list *, using methods of said class to clarify the
+ code.
+ * reload1.c (set_initial_label_offsets): Split local "x" into two
+ per-loop variables, strengthening the first from rtx to
+ rtx_expr_list * and using methods.
+
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* coretypes.h (class rtx_expr_list): Add forward declaration.
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
{
rtx_insn *insn;
- rtx x;
enum rtx_code code;
edge e;
edge_iterator ei;
everything on the forced_labels list. */
else if (computed_jump_p (insn))
{
- for (x = forced_labels; x; x = XEXP (x, 1))
- make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
+ for (rtx_expr_list *x = forced_labels; x; x = x->next ())
+ make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL);
}
/* Returns create an exit out. */
taken, then only calls to those functions or to other
nested functions that use them could possibly do
nonlocal gotos. */
- for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+ for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
make_label_edge (edge_cache, bb, XEXP (x, 0),
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
}
static void
create_trace_edges (rtx insn)
{
- rtx tmp, lab;
+ rtx tmp;
int i, n;
if (JUMP_P (insn))
n = GET_NUM_ELEM (vec);
for (i = 0; i < n; ++i)
{
- lab = XEXP (RTVEC_ELT (vec, i), 0);
+ rtx lab = XEXP (RTVEC_ELT (vec, i), 0);
maybe_record_trace_start (lab, insn);
}
}
else if (computed_jump_p (insn))
{
- for (lab = forced_labels; lab; lab = XEXP (lab, 1))
- maybe_record_trace_start (XEXP (lab, 0), insn);
+ for (rtx_expr_list *lab = forced_labels; lab; lab = lab->next ())
+ maybe_record_trace_start (lab->element (), insn);
}
else if (returnjump_p (insn))
;
n = ASM_OPERANDS_LABEL_LENGTH (tmp);
for (i = 0; i < n; ++i)
{
- lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
+ rtx lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
maybe_record_trace_start (lab, insn);
}
}
else
{
- lab = JUMP_LABEL (insn);
+ rtx lab = JUMP_LABEL (insn);
gcc_assert (lab != NULL);
maybe_record_trace_start (lab, insn);
}
/* Process non-local goto edges. */
if (can_nonlocal_goto (insn))
- for (lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
+ for (rtx lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
maybe_record_trace_start_abnormal (XEXP (lab, 0), insn);
}
else if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
rtx x_apply_args_value;
/* List of labels that must never be deleted. */
- rtx x_forced_labels;
+ rtx_expr_list *x_forced_labels;
};
typedef struct call_site_record_d *call_site_record;
static void
rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
{
- rtx insn;
+ rtx_expr_list *insn;
timevar_push (TV_REBUILD_JUMP);
init_label_info (f);
count doesn't drop to zero. */
if (count_forced)
- for (insn = forced_labels; insn; insn = XEXP (insn, 1))
- if (LABEL_P (XEXP (insn, 0)))
- LABEL_NUSES (XEXP (insn, 0))++;
+ for (insn = forced_labels; insn; insn = insn->next ())
+ if (LABEL_P (insn->element ()))
+ LABEL_NUSES (insn->element ())++;
timevar_pop (TV_REBUILD_JUMP);
}
static void
set_initial_label_offsets (void)
{
- rtx x;
memset (offsets_known_at, 0, num_labels);
- for (x = forced_labels; x; x = XEXP (x, 1))
- if (XEXP (x, 0))
- set_label_offsets (XEXP (x, 0), NULL, 1);
+ for (rtx_expr_list *x = forced_labels; x; x = x->next ())
+ if (x->element ())
+ set_label_offsets (x->element (), NULL, 1);
- for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+ for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
if (XEXP (x, 0))
set_label_offsets (XEXP (x, 0), NULL, 1);