Commit 30db48d9 by David Malcolm Committed by David Malcolm

varasm.c: Use rtx_sequence

gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* varasm.c (mark_constants): Convert a GET_CODE check into a
	dyn_cast, strengthening local "seq" from rtx to rtx_sequence *.
	Use methods of rtx_sequence to clarify the code.

From-SVN: r214600
parent b302a90f
2014-08-27 David Malcolm <dmalcolm@redhat.com> 2014-08-27 David Malcolm <dmalcolm@redhat.com>
* varasm.c (mark_constants): Convert a GET_CODE check into a
dyn_cast, strengthening local "seq" from rtx to rtx_sequence *.
Use methods of rtx_sequence to clarify the code.
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* sched-vis.c (print_pattern): Within SEQUENCE case, introduce a * sched-vis.c (print_pattern): Within SEQUENCE case, introduce a
local "seq" via a checked cast, and use methods of rtx_sequence local "seq" via a checked cast, and use methods of rtx_sequence
to simplify the code. to simplify the code.
......
...@@ -3928,13 +3928,12 @@ mark_constants (rtx_insn *insn) ...@@ -3928,13 +3928,12 @@ mark_constants (rtx_insn *insn)
/* Insns may appear inside a SEQUENCE. Only check the patterns of /* Insns may appear inside a SEQUENCE. Only check the patterns of
insns, not any notes that may be attached. We don't want to mark insns, not any notes that may be attached. We don't want to mark
a constant just because it happens to appear in a REG_EQUIV note. */ a constant just because it happens to appear in a REG_EQUIV note. */
if (GET_CODE (PATTERN (insn)) == SEQUENCE) if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
{ {
rtx seq = PATTERN (insn); int i, n = seq->len ();
int i, n = XVECLEN (seq, 0);
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
{ {
rtx subinsn = XVECEXP (seq, 0, i); rtx subinsn = seq->element (i);
if (INSN_P (subinsn)) if (INSN_P (subinsn))
for_each_rtx (&PATTERN (subinsn), mark_constant, NULL); for_each_rtx (&PATTERN (subinsn), mark_constant, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment