From: Trevor Saunders Date: Thu, 4 Sep 2014 21:11:23 +0000 (+0000) Subject: Change the types of arguments and return values for several functions from rtx to... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4685bc8caf5da2142eabeda9536567b1ea7bc12;p=gcc.git Change the types of arguments and return values for several functions from rtx to rtx_insn * gcc/ChangeLog: 2014-09-04 Trevor Saunders * emit-rtl.c (get_first_nonnote_insn): Return rtx_insn * instead of rtx. (get_last_nonnote_insn): Likewise. (next_nonnote_insn_bb): Take rtx_insn * instead of rtx. * resource.c (find_basic_block): Likewise. * rtl.h: Adjust. * rtlanal.c (keep_with_call_p): Take const rtx_insn * instead of const_rtx. From-SVN: r214922 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4d5793b635..62d056266f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-09-04 Trevor Saunders + + * emit-rtl.c (get_first_nonnote_insn): Return rtx_insn * instead of + rtx. + (get_last_nonnote_insn): Likewise. + (next_nonnote_insn_bb): Take rtx_insn * instead of rtx. + * resource.c (find_basic_block): Likewise. + * rtl.h: Adjust. + * rtlanal.c (keep_with_call_p): Take const rtx_insn * instead of + const_rtx. + 2014-09-04 David Malcolm * genattr.c (main): Within the prototype of insn_latency written diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index c257fbe3381..fdd2f94a0bb 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3141,7 +3141,7 @@ get_last_insn_anywhere (void) /* Return the first nonnote insn emitted in current sequence or current function. This routine looks inside SEQUENCEs. */ -rtx +rtx_insn * get_first_nonnote_insn (void) { rtx_insn *insn = get_insns (); @@ -3167,7 +3167,7 @@ get_first_nonnote_insn (void) /* Return the last nonnote insn emitted in current sequence or current function. This routine looks inside SEQUENCEs. */ -rtx +rtx_insn * get_last_nonnote_insn (void) { rtx_insn *insn = get_last_insn (); @@ -3267,10 +3267,8 @@ next_nonnote_insn (rtx uncast_insn) look inside SEQUENCEs. */ rtx_insn * -next_nonnote_insn_bb (rtx uncast_insn) +next_nonnote_insn_bb (rtx_insn *insn) { - rtx_insn *insn = safe_as_a (uncast_insn); - while (insn) { insn = NEXT_INSN (insn); diff --git a/gcc/resource.c b/gcc/resource.c index 95c5f283b9e..55288317fbc 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -78,7 +78,7 @@ static HARD_REG_SET current_live_regs; static HARD_REG_SET pending_dead_regs; static void update_live_status (rtx, const_rtx, void *); -static int find_basic_block (rtx, int); +static int find_basic_block (rtx_insn *, int); static rtx_insn *next_insn_no_annul (rtx_insn *); static rtx_insn *find_dead_or_set_registers (rtx_insn *, struct resources*, rtx *, int, struct resources, @@ -132,7 +132,7 @@ update_live_status (rtx dest, const_rtx x, void *data ATTRIBUTE_UNUSED) correct. */ static int -find_basic_block (rtx insn, int search_limit) +find_basic_block (rtx_insn *insn, int search_limit) { /* Scan backwards to the previous BARRIER. Then see if we can find a label that starts a basic block. Return the basic block number. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 10f4bbe8c4d..70af1cfa90f 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2530,8 +2530,8 @@ extern rtx convert_memory_address_addr_space (enum machine_mode, rtx, convert_memory_address_addr_space ((to_mode), (x), ADDR_SPACE_GENERIC) extern const char *get_insn_name (int); extern rtx_insn *get_last_insn_anywhere (void); -extern rtx get_first_nonnote_insn (void); -extern rtx get_last_nonnote_insn (void); +extern rtx_insn *get_first_nonnote_insn (void); +extern rtx_insn *get_last_nonnote_insn (void); extern void start_sequence (void); extern void push_to_sequence (rtx_insn *); extern void push_to_sequence2 (rtx_insn *, rtx_insn *); @@ -2625,7 +2625,7 @@ extern rtx_insn *next_insn (rtx_insn *); extern rtx_insn *prev_nonnote_insn (rtx); extern rtx_insn *prev_nonnote_insn_bb (rtx); extern rtx_insn *next_nonnote_insn (rtx); -extern rtx_insn *next_nonnote_insn_bb (rtx); +extern rtx_insn *next_nonnote_insn_bb (rtx_insn *); extern rtx_insn *prev_nondebug_insn (rtx); extern rtx_insn *next_nondebug_insn (rtx); extern rtx_insn *prev_nonnote_nondebug_insn (rtx); @@ -2830,7 +2830,7 @@ extern void remove_node_from_expr_list (const_rtx, rtx_expr_list **); extern void remove_node_from_insn_list (const rtx_insn *, rtx_insn_list **); extern int loc_mentioned_in_p (rtx *, const_rtx); extern rtx_insn *find_first_parameter_load (rtx_insn *, rtx_insn *); -extern bool keep_with_call_p (const_rtx); +extern bool keep_with_call_p (const rtx_insn *); extern bool label_is_jump_target_p (const_rtx, const rtx_insn *); extern int insn_rtx_cost (rtx, bool); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 080a14f47e3..9b554e228fd 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -3800,7 +3800,7 @@ find_first_parameter_load (rtx_insn *call_insn, rtx_insn *boundary) call instruction. */ bool -keep_with_call_p (const_rtx insn) +keep_with_call_p (const rtx_insn *insn) { rtx set; @@ -3824,7 +3824,8 @@ keep_with_call_p (const_rtx insn) /* This CONST_CAST is okay because next_nonnote_insn just returns its argument and we assign it to a const_rtx variable. */ - const rtx_insn *i2 = next_nonnote_insn (CONST_CAST_RTX (insn)); + const rtx_insn *i2 + = next_nonnote_insn (const_cast (insn)); if (i2 && keep_with_call_p (i2)) return true; }