Commit 049cfc4a by David Malcolm Committed by David Malcolm

last_call_insn returns an rtx_call_insn *

2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* emit-rtl.c (last_call_insn): Strengthen return type from rtx to
	rtx_call_insn *.
	* rtl.h (is_a_helper <rtx_call_insn *>::test): New overload,
	accepting an rtx_insn *.
	(last_call_insn): Strengthen return type from rtx to
	rtx_call_insn *.

From-SVN: r214186
parent 169d13f5
2014-08-19 David Malcolm <dmalcolm@redhat.com> 2014-08-19 David Malcolm <dmalcolm@redhat.com>
* emit-rtl.c (last_call_insn): Strengthen return type from rtx to
rtx_call_insn *.
* rtl.h (is_a_helper <rtx_call_insn *>::test): New overload,
accepting an rtx_insn *.
(last_call_insn): Strengthen return type from rtx to
rtx_call_insn *.
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* rtl.h (delete_trivially_dead_insns): Strengthen initial param * rtl.h (delete_trivially_dead_insns): Strengthen initial param
"insns" from rtx to rtx_insn *. "insns" from rtx to rtx_insn *.
* cse.c (delete_trivially_dead_insns): Likewise, also do it for * cse.c (delete_trivially_dead_insns): Likewise, also do it for
......
...@@ -3382,17 +3382,17 @@ prev_real_insn (rtx insn) ...@@ -3382,17 +3382,17 @@ prev_real_insn (rtx insn)
/* Return the last CALL_INSN in the current list, or 0 if there is none. /* Return the last CALL_INSN in the current list, or 0 if there is none.
This routine does not look inside SEQUENCEs. */ This routine does not look inside SEQUENCEs. */
rtx rtx_call_insn *
last_call_insn (void) last_call_insn (void)
{ {
rtx insn; rtx_insn *insn;
for (insn = get_last_insn (); for (insn = get_last_insn ();
insn && !CALL_P (insn); insn && !CALL_P (insn);
insn = PREV_INSN (insn)) insn = PREV_INSN (insn))
; ;
return insn; return safe_as_a <rtx_call_insn *> (insn);
} }
/* Find the next insn after INSN that really does something. This routine /* Find the next insn after INSN that really does something. This routine
......
...@@ -734,6 +734,14 @@ is_a_helper <rtx_call_insn *>::test (rtx rt) ...@@ -734,6 +734,14 @@ is_a_helper <rtx_call_insn *>::test (rtx rt)
template <> template <>
template <> template <>
inline bool inline bool
is_a_helper <rtx_call_insn *>::test (rtx_insn *insn)
{
return CALL_P (insn);
}
template <>
template <>
inline bool
is_a_helper <rtx_jump_table_data *>::test (rtx rt) is_a_helper <rtx_jump_table_data *>::test (rtx rt)
{ {
return JUMP_TABLE_DATA_P (rt); return JUMP_TABLE_DATA_P (rt);
...@@ -2416,7 +2424,7 @@ extern rtx gen_use (rtx); ...@@ -2416,7 +2424,7 @@ extern rtx gen_use (rtx);
extern rtx emit_use (rtx); extern rtx emit_use (rtx);
extern rtx make_insn_raw (rtx); extern rtx make_insn_raw (rtx);
extern void add_function_usage_to (rtx, rtx); extern void add_function_usage_to (rtx, rtx);
extern rtx last_call_insn (void); extern rtx_call_insn *last_call_insn (void);
extern rtx_insn *previous_insn (rtx); extern rtx_insn *previous_insn (rtx);
extern rtx_insn *next_insn (rtx); extern rtx_insn *next_insn (rtx);
extern rtx_insn *prev_nonnote_insn (rtx); extern rtx_insn *prev_nonnote_insn (rtx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment