diff options
author | David Malcolm <dmalcolm@redhat.com> | 2018-06-13 13:43:32 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2018-06-13 13:43:32 +0000 |
commit | 4dea3bff792b49a1eb72ee9ef15d7961fa9150c8 (patch) | |
tree | 286abdd9c73651c3d54becf821556bfd02fb9061 /gcc/rtl.h | |
parent | b4da704c6ea9e69c6733fe86b5045b00f2775462 (diff) | |
download | gcc-4dea3bff792b49a1eb72ee9ef15d7961fa9150c8.zip gcc-4dea3bff792b49a1eb72ee9ef15d7961fa9150c8.tar.gz gcc-4dea3bff792b49a1eb72ee9ef15d7961fa9150c8.tar.bz2 |
emit-rtl.c: more typesafety
This patch converts various rtx to rtx_insn * (or rtx_code_label *).
It also convert the various "_loc" params from int to location_t
gcc/ChangeLog:
* config/arc/arc.c (hwloop_optimize): Strengthen local "end_label"
from rtx to rtx_insn *.
* config/bfin/bfin.c (hwloop_optimize): Likewise for local
"label".
(add_sched_insns_for_speculation): Likewise for local "target",
converting usage of JUMP_LABEL to JUMP_LABEL_AS_INSN.
* config/c6x/c6x.c (reorg_split_calls): Strengthen param "call_labels"
from rtx_insn ** to rtx_code_label **.
(reorg_emit_nops): Likewise.
(c6x_reorg): Likewise for local "call_labels".
* config/sh/sh-protos.h (get_dest_uid): Strengthen 1st param from
rtx to rtx_insn *.
* config/sh/sh.c (dump_table): Strengthen local "lab" from rtx to
rtx_code_label *, adding safe_as_a <rtx_code_label *> casts to
the loops over LABEL_REFS.
(fixup_addr_diff_vecs): Add as_a <rtx_insn *> to usage of
braf_label.
(barrier_align): Convert usage of JUMP_LABEL to JUMP_LABEL_AS_INSN.
(get_dest_uid): Strengthen param "label" from rtx to rtx_insn *.
(split_branches): Strengthen local "olabel" from rtx to
rtx_insn *, adding a safe_as_a cast.
* emit-rtl.c (next_real_insn): Strengthen param from "rtx"
to "rtx_insn *".
(add_insn_after): Likewise for first two params.
(add_insn_before): Likewise.
(remove_insn): Likewise for param.
(emit_pattern_before_noloc): Likewise for second and third params.
(emit_jump_insn_before_noloc): Convert NULL_RTX to NULL.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): Strengthen "before" param from "rtx"
to "rtx_insn *".
(emit_barrier_before): Likewise.
(emit_label_before): Strengthen "label" param from "rtx" to
"rtx_code_label *". Strengthen "before" param from "rtx" to
"rtx_insn *".
(emit_insn_after_1): Strengthen "after" param from "rtx" to
"rtx_insn *".
(emit_pattern_after_noloc): Likewise.
(emit_insn_after_noloc): Likewise.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_barrier_after): Likewise.
(emit_label_after): Likewise for both params.
(emit_pattern_after_setloc): Likewise for "after" param. Convert
"loc" param from "int" to "location_t".
(emit_insn_after_setloc): Likewise.
(emit_jump_insn_after_setloc): Likewise.
(emit_call_insn_after_setloc): Likewise.
(emit_debug_insn_after_setloc): Likewise.
(emit_pattern_before_setloc): Likewise for "before" param. Convert
"loc" param from "int" to "location_t".
(emit_pattern_before): Convert NULL_RTX to NULL.
(emit_insn_before_setloc): Convert "loc" param from "int" to
"location_t".
(emit_jump_insn_before_setloc): Likewise.
(emit_call_insn_before_setloc): Likewise.
(emit_debug_insn_before_setloc): Strengthen "before" param from rtx to
rtx_insn *. Convert "loc" param from "int" to "location_t".
* rtl.h (emit_insn_before_setloc, emit_jump_insn_before_setloc,
emit_call_insn_before_setloc, emit_debug_insn_before_setloc):
Convert 3rd param from "int" to "location_t".
(emit_barrier_before, emit_barrier_after, next_real_insn):
Strengthen param from rtx to rtx_insn *.
(emit_label_before): Strengthen 1st param from "rtx" to
"rtx_code_label *". Strengthen 2nd param from "rtx" to
"rtx_insn *".
(emit_insn_after_noloc, emit_jump_insn_after_noloc,
emit_call_insn_after_noloc, emit_debug_insn_after_noloc):
Strengthen 2nd param from "rtx" to "rtx_insn *".
(emit_insn_after_setloc, emit_jump_insn_after_setloc)
emit_call_insn_after_setloc, emit_debug_insn_after_setloc):
Likewise. Convert 3rd param from "int" to "location_t".
(emit_label_after): Strengthen 1st param from "rtx" to
"rtx_code_label *".
(next_real_insn, remove_insn): Strengthen param from "rtx" to
"rtx_insn *".
(add_insn_before, add_insn_after): Strengthen 1st and 2nd params
from "rtx" to "rtx_insn *".
From-SVN: r261547
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -3216,33 +3216,34 @@ extern void decide_function_section (tree); /* In emit-rtl.c */ extern rtx_insn *emit_insn_before (rtx, rtx); extern rtx_insn *emit_insn_before_noloc (rtx, rtx_insn *, basic_block); -extern rtx_insn *emit_insn_before_setloc (rtx, rtx_insn *, int); +extern rtx_insn *emit_insn_before_setloc (rtx, rtx_insn *, location_t); extern rtx_jump_insn *emit_jump_insn_before (rtx, rtx); extern rtx_jump_insn *emit_jump_insn_before_noloc (rtx, rtx_insn *); -extern rtx_jump_insn *emit_jump_insn_before_setloc (rtx, rtx_insn *, int); +extern rtx_jump_insn *emit_jump_insn_before_setloc (rtx, rtx_insn *, + location_t); extern rtx_insn *emit_call_insn_before (rtx, rtx_insn *); extern rtx_insn *emit_call_insn_before_noloc (rtx, rtx_insn *); -extern rtx_insn *emit_call_insn_before_setloc (rtx, rtx_insn *, int); +extern rtx_insn *emit_call_insn_before_setloc (rtx, rtx_insn *, location_t); extern rtx_insn *emit_debug_insn_before (rtx, rtx_insn *); extern rtx_insn *emit_debug_insn_before_noloc (rtx, rtx); -extern rtx_insn *emit_debug_insn_before_setloc (rtx, rtx, int); -extern rtx_barrier *emit_barrier_before (rtx); -extern rtx_code_label *emit_label_before (rtx, rtx_insn *); +extern rtx_insn *emit_debug_insn_before_setloc (rtx, rtx_insn *, location_t); +extern rtx_barrier *emit_barrier_before (rtx_insn *); +extern rtx_code_label *emit_label_before (rtx_code_label *, rtx_insn *); extern rtx_note *emit_note_before (enum insn_note, rtx_insn *); extern rtx_insn *emit_insn_after (rtx, rtx); -extern rtx_insn *emit_insn_after_noloc (rtx, rtx, basic_block); -extern rtx_insn *emit_insn_after_setloc (rtx, rtx, int); +extern rtx_insn *emit_insn_after_noloc (rtx, rtx_insn *, basic_block); +extern rtx_insn *emit_insn_after_setloc (rtx, rtx_insn *, location_t); extern rtx_jump_insn *emit_jump_insn_after (rtx, rtx); -extern rtx_jump_insn *emit_jump_insn_after_noloc (rtx, rtx); -extern rtx_jump_insn *emit_jump_insn_after_setloc (rtx, rtx, int); +extern rtx_jump_insn *emit_jump_insn_after_noloc (rtx, rtx_insn *); +extern rtx_jump_insn *emit_jump_insn_after_setloc (rtx, rtx_insn *, location_t); extern rtx_insn *emit_call_insn_after (rtx, rtx); -extern rtx_insn *emit_call_insn_after_noloc (rtx, rtx); -extern rtx_insn *emit_call_insn_after_setloc (rtx, rtx, int); +extern rtx_insn *emit_call_insn_after_noloc (rtx, rtx_insn *); +extern rtx_insn *emit_call_insn_after_setloc (rtx, rtx_insn *, location_t); extern rtx_insn *emit_debug_insn_after (rtx, rtx); -extern rtx_insn *emit_debug_insn_after_noloc (rtx, rtx); -extern rtx_insn *emit_debug_insn_after_setloc (rtx, rtx, int); -extern rtx_barrier *emit_barrier_after (rtx); -extern rtx_insn *emit_label_after (rtx, rtx_insn *); +extern rtx_insn *emit_debug_insn_after_noloc (rtx, rtx_insn *); +extern rtx_insn *emit_debug_insn_after_setloc (rtx, rtx_insn *, location_t); +extern rtx_barrier *emit_barrier_after (rtx_insn *); +extern rtx_insn *emit_label_after (rtx_insn *, rtx_insn *); extern rtx_note *emit_note_after (enum insn_note, rtx_insn *); extern rtx_insn *emit_insn (rtx); extern rtx_insn *emit_debug_insn (rtx); @@ -3271,7 +3272,7 @@ extern rtx_insn *prev_nonnote_nondebug_insn_bb (rtx_insn *); extern rtx_insn *next_nonnote_nondebug_insn (rtx_insn *); extern rtx_insn *next_nonnote_nondebug_insn_bb (rtx_insn *); extern rtx_insn *prev_real_insn (rtx_insn *); -extern rtx_insn *next_real_insn (rtx); +extern rtx_insn *next_real_insn (rtx_insn *); extern rtx_insn *prev_real_nondebug_insn (rtx_insn *); extern rtx_insn *next_real_nondebug_insn (rtx); extern rtx_insn *prev_active_insn (rtx_insn *); @@ -3963,9 +3964,9 @@ extern void unshare_all_rtl_again (rtx_insn *); extern void unshare_all_rtl_in_chain (rtx_insn *); extern void verify_rtl_sharing (void); extern void add_insn (rtx_insn *); -extern void add_insn_before (rtx, rtx, basic_block); -extern void add_insn_after (rtx, rtx, basic_block); -extern void remove_insn (rtx); +extern void add_insn_before (rtx_insn *, rtx_insn *, basic_block); +extern void add_insn_after (rtx_insn *, rtx_insn *, basic_block); +extern void remove_insn (rtx_insn *); extern rtx_insn *emit (rtx, bool = true); extern void emit_insn_at_entry (rtx); extern rtx gen_lowpart_SUBREG (machine_mode, rtx); |