summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-26 18:56:58 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-26 18:56:58 +0000
commit26bb3cb202f845d410baa38991e106c3cdaca731 (patch)
treec54ed14919bfd87d09336476cd238800a117c656 /gcc/emit-rtl.c
parent3c3f97b49b3108808d83ca8fd11192577e0ae4d0 (diff)
downloadgcc-26bb3cb202f845d410baa38991e106c3cdaca731.tar.gz
Remove BB_HEAD, BB_END, BB_HEADER scaffolding
gcc/ * basic-block.h (struct rtl_bb_info): Strengthen fields "end_" and "header_" from rtx to rtx_insn *. (struct basic_block_d): Likewise for field "head_" within "x" field of union basic_block_il_dependent. (BB_HEAD): Drop function... (SET_BB_HEAD): ...and this function in favor of... (BB_HEAD): ...reinstate macro. (BB_END): Drop function... (SET_BB_END): ...and this function in favor of... (BB_END): ...reinstate macro. (BB_HEADER): Drop function... (SET_BB_HEADER): ...and this function in favor of... (BB_HEADER): ...reinstate macro. * bb-reorder.c (add_labels_and_missing_jumps): Drop use of BB_END. (fix_crossing_unconditional_branches): Likewise. * caller-save.c (save_call_clobbered_regs): Likewise. (insert_one_insn): Drop use of SET_BB_HEAD and SET_BB_END. * cfgbuild.c (find_bb_boundaries): Drop use of SET_BB_END. * cfgcleanup.c (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (outgoing_edges_match): Update use of for_each_rtx to for_each_rtx_in_insn. * cfgexpand.c (expand_gimple_cond): Drop use of SET_BB_END. (expand_gimple_cond): Likewise. (expand_gimple_tailcall): Likewise. (expand_gimple_basic_block): Drop use of SET_BB_HEAD and SET_BB_END. (construct_exit_block): Drop use of SET_BB_END. * cfgrtl.c (cfg_layout_function_footer): Strengthen from rtx to rtx_insn *. (delete_insn): Rename param "insn" to "uncast_insn", introducing a new local "insn" with a checked cast to rtx_insn *. Drop use of SET_BB_HEAD and SET_BB_END. (create_basic_block_structure): Drop use of SET_BB_HEAD and SET_BB_END. (rtl_delete_block): Drop use of SET_BB_HEAD. (rtl_split_block): Drop use of SET_BB_END. (emit_nop_for_unique_locus_between): Likewise. (rtl_merge_blocks): Drop use of SET_BB_END and SET_BB_HEAD. (block_label): Drop use of SET_BB_HEAD. (fixup_abnormal_edges): Drop use of SET_BB_END. (record_effective_endpoints): Drop use of SET_BB_HEADER. (relink_block_chain): Likewise. (fixup_reorder_chain): Drop use of SET_BB_END. (cfg_layout_duplicate_bb): Drop use of SET_BB_HEADER. (cfg_layout_delete_block): Strengthen local "to" from rtx * to rtx_insn **. Drop use of SET_BB_HEADER. (cfg_layout_merge_blocks): Drop use of SET_BB_HEADER, SET_BB_END, SET_BB_HEAD. (BB_HEAD): Delete this function. (SET_BB_HEAD): Likewise. (BB_END): Likewise. (SET_BB_END): Likewise. (BB_HEADER): Likewise. (SET_BB_HEADER): Likewise. * emit-rtl.c (add_insn_after): Rename param "insn" to "uncast_insn", adding a new local "insn" and a checked cast to rtx_insn *. Drop use of SET_BB_END. (remove_insn): Strengthen locals "next" and "prev" from rtx to rtx_insn *. Drop use of SET_BB_HEAD and SET_BB_END. (reorder_insns): Drop use of SET_BB_END. (emit_insn_after_1): Strengthen param "first" and locals "last", "after_after" from rtx to rtx_insn *. Drop use of SET_BB_END. (emit_pattern_after_noloc): Add checked cast. * haifa-sched.c (get_ebb_head_tail): Drop use of SET_BB_END. (restore_other_notes): Likewise. (move_insn): Likewise. (sched_extend_bb): Likewise. (fix_jump_move): Likewise. * ifcvt.c (noce_process_if_block): Likewise. (dead_or_predicable): Likewise. * ira.c (update_equiv_regs): Drop use of SET_BB_HEAD. * reg-stack.c (change_stack): Drop use of SET_BB_END. * sel-sched-ir.c (sel_move_insn): Likewise. * sel-sched.c (move_nop_to_previous_block): Likewise. * config/c6x/c6x.c (hwloop_optimize): Drop use of SET_BB_HEAD and SET_BB_END. * config/ia64/ia64.c (emit_predicate_relation_info): Likewise. / * rtx-classes-status.txt (TODO): SET_BB_HEAD, SET_BB_END, SET_BB_HEADER are done. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 84594d892b6..2e09160e711 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3982,8 +3982,9 @@ add_insn_before_nobb (rtx insn, rtx before)
they know how to update a SEQUENCE. */
void
-add_insn_after (rtx insn, rtx after, basic_block bb)
+add_insn_after (rtx uncast_insn, rtx after, basic_block bb)
{
+ rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
add_insn_after_nobb (insn, after);
if (!BARRIER_P (after)
&& !BARRIER_P (insn)
@@ -3998,7 +3999,7 @@ add_insn_after (rtx insn, rtx after, basic_block bb)
/* Avoid clobbering of structure when creating new BB. */
&& !BARRIER_P (insn)
&& !NOTE_INSN_BASIC_BLOCK_P (insn))
- SET_BB_END (bb) = insn;
+ BB_END (bb) = insn;
}
}
@@ -4063,8 +4064,8 @@ set_insn_deleted (rtx insn)
void
remove_insn (rtx insn)
{
- rtx next = NEXT_INSN (insn);
- rtx prev = PREV_INSN (insn);
+ rtx_insn *next = NEXT_INSN (insn);
+ rtx_insn *prev = PREV_INSN (insn);
basic_block bb;
if (prev)
@@ -4127,10 +4128,10 @@ remove_insn (rtx insn)
/* Never ever delete the basic block note without deleting whole
basic block. */
gcc_assert (!NOTE_P (insn));
- SET_BB_HEAD (bb) = next;
+ BB_HEAD (bb) = next;
}
if (BB_END (bb) == insn)
- SET_BB_END (bb) = prev;
+ BB_END (bb) = prev;
}
}
@@ -4230,12 +4231,12 @@ reorder_insns (rtx_insn *from, rtx_insn *to, rtx_insn *after)
&& (bb2 = BLOCK_FOR_INSN (from)))
{
if (BB_END (bb2) == to)
- SET_BB_END (bb2) = prev;
+ BB_END (bb2) = prev;
df_set_bb_dirty (bb2);
}
if (BB_END (bb) == after)
- SET_BB_END (bb) = to;
+ BB_END (bb) = to;
for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
if (!BARRIER_P (x))
@@ -4381,10 +4382,10 @@ emit_label_before (rtx label, rtx before)
efficiently. */
static rtx
-emit_insn_after_1 (rtx first, rtx after, basic_block bb)
+emit_insn_after_1 (rtx_insn *first, rtx after, basic_block bb)
{
- rtx last;
- rtx after_after;
+ rtx_insn *last;
+ rtx_insn *after_after;
if (!bb && !BARRIER_P (after))
bb = BLOCK_FOR_INSN (after);
@@ -4403,7 +4404,7 @@ emit_insn_after_1 (rtx first, rtx after, basic_block bb)
df_insn_rescan (last);
}
if (BB_END (bb) == after)
- SET_BB_END (bb) = last;
+ BB_END (bb) = last;
}
else
for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
@@ -4443,7 +4444,7 @@ emit_pattern_after_noloc (rtx x, rtx after, basic_block bb,
case CODE_LABEL:
case BARRIER:
case NOTE:
- last = emit_insn_after_1 (x, after, bb);
+ last = emit_insn_after_1 (as_a <rtx_insn *> (x), after, bb);
break;
#ifdef ENABLE_RTL_CHECKING