[59/77] Add a rtx_jump_table_data::get_data_mode helper
commiteb894c13ea608c1b934080b0c7394ed65d5e9cfa
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:18:37 +0000 (30 11:18 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:18:37 +0000 (30 11:18 +0000)
treea2c9e2b70bbf121f659d36303df886bad0895c81
parent5e2799ea8ac58bb39840a49a28b702c23efd2334
[59/77] Add a rtx_jump_table_data::get_data_mode helper

This patch adds a helper function to get the mode of the addresses
or offsets in a jump table.  It also changes the final.c code to use
rtx_jump_table_data over rtx or rtx_insn in cases where it needed
to use the new helper.  This in turn meant adding a safe_dyn_cast
equivalent of safe_as_a, to cope with null NEXT_INSNs.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* is-a.h (safe_dyn_cast): New function.
* rtl.h (rtx_jump_table_data::get_data_mode): New function.
(jump_table_for_label): Likewise.
* final.c (final_addr_vec_align): Take an rtx_jump_table_data *
instead of an rtx_insn *.
(shorten_branches): Use dyn_cast instead of LABEL_P and
JUMP_TABLE_DATA_P.  Use jump_table_for_label and
rtx_jump_table_data::get_data_mode.
(final_scan_insn): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251511 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/final.c
gcc/is-a.h
gcc/rtl.h