From: dmalcolm Date: Wed, 27 Aug 2014 20:26:27 +0000 (+0000) Subject: sched-vis.c: Use rtx_sequence X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a85392dd406bf5ae42bc0fffb5e34bf3bd716919;p=thirdparty%2Fgcc.git sched-vis.c: Use rtx_sequence gcc/ 2014-08-27 David Malcolm * sched-vis.c (print_pattern): Within SEQUENCE case, introduce a local "seq" via a checked cast, and use methods of rtx_sequence to simplify the code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214599 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 162722c8622c..52641234eb2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-08-27 David Malcolm + + * sched-vis.c (print_pattern): Within SEQUENCE case, introduce a + local "seq" via a checked cast, and use methods of rtx_sequence + to simplify the code. + 2014-08-27 David Malcolm * resource.c (mark_referenced_resources): Strengthen local diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index b35c137f7c4f..bcce40d6c6d6 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -578,8 +578,9 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose) break; case SEQUENCE: { + const rtx_sequence *seq = as_a (x); pp_string (pp, "sequence{"); - if (INSN_P (XVECEXP (x, 0, 0))) + if (INSN_P (seq->element (0))) { /* Print the sequence insns indented. */ const char * save_print_rtx_head = print_rtx_head; @@ -591,16 +592,16 @@ print_pattern (pretty_printer *pp, const_rtx x, int verbose) sizeof (indented_print_rtx_head), "%s ", print_rtx_head); print_rtx_head = indented_print_rtx_head; - for (int i = 0; i < XVECLEN (x, 0); i++) - print_insn_with_notes (pp, XVECEXP (x, 0, i)); + for (int i = 0; i < seq->len (); i++) + print_insn_with_notes (pp, seq->insn (i)); pp_printf (pp, "%s ", save_print_rtx_head); print_rtx_head = save_print_rtx_head; } else { - for (int i = 0; i < XVECLEN (x, 0); i++) + for (int i = 0; i < seq->len (); i++) { - print_pattern (pp, XVECEXP (x, 0, i), verbose); + print_pattern (pp, seq->element (i), verbose); pp_semicolon (pp); } }