+2014-08-26 David Malcolm <dmalcolm@redhat.com>
+
+ * rtl.h (add_insn): Strengthen param from rtx to rtx_insn *.
+ (unlink_insn_chain): Strengthen both params from rtx to
+ rtx_insn *.
+
+ * cfgrtl.c (cfg_layout_function_header): Likewise for this
+ variable.
+ (unlink_insn_chain): Likewise for params "first" and "last".
+ Remove now-redundant checked cast.
+ (record_effective_endpoints): Replace use of NULL_RTX with NULL.
+ (fixup_reorder_chain): Strengthen local "insn" from rtx to
+ rtx_insn *.
+ * emit-rtl.c (link_insn_into_chain): Likewise for all three
+ params.
+ (add_insn): Likewise for param "insn" and local "prev".
+ (add_insn_after_nobb): Likewise for both params and local "next".
+ (add_insn_before_nobb): Likewise for both params and local "prev".
+ (add_insn_after): Rename param "after" to "uncast_after",
+ introducing local "after" with another checked cast.
+ (add_insn_before): Rename params "insn" and "before", giving them
+ "uncast_" prefixes, adding the old names back using checked casts.
+ (emit_note_after): Likewise for param "after".
+ (emit_note_before): Likewise for param "before".
+ (emit_label): Add a checked cast.
+
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* cselib.h (cselib_record_sets_hook): Strengthen initial param
/* Holds the interesting leading and trailing notes for the function.
Only applicable if the CFG is in cfglayout mode. */
static GTY(()) rtx_insn *cfg_layout_function_footer;
-static GTY(()) rtx cfg_layout_function_header;
+static GTY(()) rtx_insn *cfg_layout_function_header;
static rtx_insn *skip_insns_after_block (basic_block);
static void record_effective_endpoints (void);
/* Cut the insns from FIRST to LAST out of the insns stream. */
rtx_insn *
-unlink_insn_chain (rtx first, rtx last)
+unlink_insn_chain (rtx_insn *first, rtx_insn *last)
{
rtx_insn *prevfirst = PREV_INSN (first);
rtx_insn *nextlast = NEXT_INSN (last);
set_last_insn (prevfirst);
if (!prevfirst)
set_first_insn (nextlast);
- return as_a <rtx_insn *> (first);
+ return first;
}
\f
/* Skip over inter-block insns occurring after BB which are typically
cfg_layout_function_header =
unlink_insn_chain (get_insns (), PREV_INSN (insn));
else
- cfg_layout_function_header = NULL_RTX;
+ cfg_layout_function_header = NULL;
next_insn = get_insns ();
FOR_EACH_BB_FN (bb, cfun)
fixup_reorder_chain (void)
{
basic_block bb;
- rtx insn = NULL;
+ rtx_insn *insn = NULL;
if (cfg_layout_function_header)
{
but also BARRIERs and JUMP_TABLE_DATAs. PREV and NEXT may be NULL. */
static inline void
-link_insn_into_chain (rtx insn, rtx prev, rtx next)
+link_insn_into_chain (rtx_insn *insn, rtx_insn *prev, rtx_insn *next)
{
SET_PREV_INSN (insn) = prev;
SET_NEXT_INSN (insn) = next;
INSN may be an INSN, JUMP_INSN, CALL_INSN, CODE_LABEL, BARRIER or NOTE. */
void
-add_insn (rtx insn)
+add_insn (rtx_insn *insn)
{
- rtx prev = get_last_insn ();
+ rtx_insn *prev = get_last_insn ();
link_insn_into_chain (insn, prev, NULL);
if (NULL == get_insns ())
set_first_insn (insn);
/* Add INSN into the doubly-linked list after insn AFTER. */
static void
-add_insn_after_nobb (rtx insn, rtx after)
+add_insn_after_nobb (rtx_insn *insn, rtx_insn *after)
{
- rtx next = NEXT_INSN (after);
+ rtx_insn *next = NEXT_INSN (after);
gcc_assert (!optimize || !INSN_DELETED_P (after));
/* Add INSN into the doubly-linked list before insn BEFORE. */
static void
-add_insn_before_nobb (rtx insn, rtx before)
+add_insn_before_nobb (rtx_insn *insn, rtx_insn *before)
{
- rtx prev = PREV_INSN (before);
+ rtx_insn *prev = PREV_INSN (before);
gcc_assert (!optimize || !INSN_DELETED_P (before));
they know how to update a SEQUENCE. */
void
-add_insn_after (rtx uncast_insn, rtx after, basic_block bb)
+add_insn_after (rtx uncast_insn, rtx uncast_after, basic_block bb)
{
rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
+ rtx_insn *after = as_a <rtx_insn *> (uncast_after);
add_insn_after_nobb (insn, after);
if (!BARRIER_P (after)
&& !BARRIER_P (insn)
they know how to update a SEQUENCE. */
void
-add_insn_before (rtx insn, rtx before, basic_block bb)
+add_insn_before (rtx uncast_insn, rtx uncast_before, basic_block bb)
{
+ rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
+ rtx_insn *before = as_a <rtx_insn *> (uncast_before);
add_insn_before_nobb (insn, before);
if (!bb
/* Emit a note of subtype SUBTYPE after the insn AFTER. */
rtx_note *
-emit_note_after (enum insn_note subtype, rtx after)
+emit_note_after (enum insn_note subtype, rtx uncast_after)
{
+ rtx_insn *after = as_a <rtx_insn *> (uncast_after);
rtx_note *note = make_note_raw (subtype);
basic_block bb = BARRIER_P (after) ? NULL : BLOCK_FOR_INSN (after);
bool on_bb_boundary_p = (bb != NULL && BB_END (bb) == after);
/* Emit a note of subtype SUBTYPE before the insn BEFORE. */
rtx_note *
-emit_note_before (enum insn_note subtype, rtx before)
+emit_note_before (enum insn_note subtype, rtx uncast_before)
{
+ rtx_insn *before = as_a <rtx_insn *> (uncast_before);
rtx_note *note = make_note_raw (subtype);
basic_block bb = BARRIER_P (before) ? NULL : BLOCK_FOR_INSN (before);
bool on_bb_boundary_p = (bb != NULL && BB_HEAD (bb) == before);
{
gcc_checking_assert (INSN_UID (label) == 0);
INSN_UID (label) = cur_insn_uid++;
- add_insn (label);
+ add_insn (as_a <rtx_insn *> (label));
return as_a <rtx_insn *> (label);
}
extern void unshare_all_rtl_again (rtx_insn *);
extern void unshare_all_rtl_in_chain (rtx);
extern void verify_rtl_sharing (void);
-extern void add_insn (rtx);
+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 rtx_insn *entry_of_function (void);
extern void emit_insn_at_entry (rtx);
extern void delete_insn_chain (rtx, rtx, bool);
-extern rtx_insn *unlink_insn_chain (rtx, rtx);
+extern rtx_insn *unlink_insn_chain (rtx_insn *, rtx_insn *);
extern void delete_insn_and_edges (rtx_insn *);
extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx);
extern rtx gen_const_mem (enum machine_mode, rtx);