From: David Malcolm Date: Wed, 27 Aug 2014 19:59:57 +0000 (+0000) Subject: dwarf2cfi.c: Use rtx_sequence X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=292d1dfba682b01385511eeb86f0fd477c23edc5;p=gcc.git dwarf2cfi.c: Use rtx_sequence gcc/ 2014-08-27 David Malcolm * dwarf2cfi.c (create_trace_edges): Convert GET_CODE check into a dyn_cast, strengthening local "seq" from rtx to rtx_sequence *. Use methods of rtx_sequence. (scan_trace): Likewise for local "pat". From-SVN: r214592 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dce1cb407df..5ef2cd0a93f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-08-27 David Malcolm + + * dwarf2cfi.c (create_trace_edges): Convert GET_CODE check into a + dyn_cast, strengthening local "seq" from rtx to rtx_sequence *. + Use methods of rtx_sequence. + (scan_trace): Likewise for local "pat". + 2014-08-27 David Malcolm * coretypes.h (class rtx_sequence): Add forward declaration. diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index f29d9420bfd..25571fa7bcd 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2341,12 +2341,11 @@ create_trace_edges (rtx insn) for (lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1)) maybe_record_trace_start_abnormal (XEXP (lab, 0), insn); } - else if (GET_CODE (PATTERN (insn)) == SEQUENCE) + else if (rtx_sequence *seq = dyn_cast (PATTERN (insn))) { - rtx seq = PATTERN (insn); - int i, n = XVECLEN (seq, 0); + int i, n = seq->len (); for (i = 0; i < n; ++i) - create_trace_edges (XVECEXP (seq, 0, i)); + create_trace_edges (seq->insn (i)); return; } @@ -2421,12 +2420,12 @@ scan_trace (dw_trace_info *trace) /* Handle all changes to the row state. Sequences require special handling for the positioning of the notes. */ - if (GET_CODE (PATTERN (insn)) == SEQUENCE) + if (rtx_sequence *pat = dyn_cast (PATTERN (insn))) { - rtx elt, pat = PATTERN (insn); - int i, n = XVECLEN (pat, 0); + rtx elt; + int i, n = pat->len (); - control = XVECEXP (pat, 0, 0); + control = pat->element (0); if (can_throw_internal (control)) notice_eh_throw (control); dwarf2out_flush_queued_reg_saves (); @@ -2438,7 +2437,7 @@ scan_trace (dw_trace_info *trace) gcc_assert (!RTX_FRAME_RELATED_P (control)); gcc_assert (!find_reg_note (control, REG_ARGS_SIZE, NULL)); - elt = XVECEXP (pat, 0, 1); + elt = pat->element (1); if (INSN_FROM_TARGET_P (elt)) { @@ -2493,7 +2492,7 @@ scan_trace (dw_trace_info *trace) for (i = 1; i < n; ++i) { - elt = XVECEXP (pat, 0, i); + elt = pat->element (i); scan_insn_after (elt); }