diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-05 13:58:29 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-05 13:58:29 +0000 |
commit | ae9c1c11697dcde01c765abe4c7298893a9cf912 (patch) | |
tree | 6cb50cacb39e660c495147b9a1c7f753bf05b947 /gcc/jump.c | |
parent | eaa0f393eb0177b3d79f0b3f60a1e18dbafe0fff (diff) | |
download | gcc-ae9c1c11697dcde01c765abe4c7298893a9cf912.tar.gz |
Use rtx_jump_table_data in jump.c:delete_related_insns
gcc/ChangeLog
2014-09-05 David Malcolm <dmalcolm@redhat.com>
* jump.c (delete_related_insns): Introduce a new local "table" by
replacing JUMP_TABLE_DATA_P with a dyn_cast, then use the
get_labels method of "table" to simplify access to the labels in
the jump table.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214960 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 12edd927e54..84040da8307 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1314,15 +1314,15 @@ delete_related_insns (rtx uncast_insn) /* Likewise if we're deleting a dispatch table. */ - if (JUMP_TABLE_DATA_P (insn)) + if (rtx_jump_table_data *table = dyn_cast <rtx_jump_table_data *> (insn)) { - rtx pat = PATTERN (insn); - int i, diff_vec_p = GET_CODE (pat) == ADDR_DIFF_VEC; - int len = XVECLEN (pat, diff_vec_p); + rtvec labels = table->get_labels (); + int i; + int len = GET_NUM_ELEM (labels); for (i = 0; i < len; i++) - if (LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0)) == 0) - delete_related_insns (XEXP (XVECEXP (pat, diff_vec_p, i), 0)); + if (LABEL_NUSES (XEXP (RTVEC_ELT (labels, i), 0)) == 0) + delete_related_insns (XEXP (RTVEC_ELT (labels, i), 0)); while (next && INSN_DELETED_P (next)) next = NEXT_INSN (next); return next; |