diff mbox

[034/236] next_cc0_user and prev_cc0_setter scaffolding

Message ID 1407345815-14551-35-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Aug. 6, 2014, 5:20 p.m. UTC
gcc/
	* rtl.h (next_cc0_user): Strengthen return type from rtx to
	rtx_insn *.
	(prev_cc0_setter): Likewise.

	* emit-rtl.c (next_cc0_user): Strengthen return type from rtx to
	rtx_insn *, adding checked casts for now as necessary.
	(prev_cc0_setter): Likewise.
---
 gcc/emit-rtl.c | 12 ++++++------
 gcc/rtl.h      |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Jeff Law Aug. 13, 2014, 5:55 p.m. UTC | #1
On 08/06/14 11:20, David Malcolm wrote:
> gcc/
> 	* rtl.h (next_cc0_user): Strengthen return type from rtx to
> 	rtx_insn *.
> 	(prev_cc0_setter): Likewise.
>
> 	* emit-rtl.c (next_cc0_user): Strengthen return type from rtx to
> 	rtx_insn *, adding checked casts for now as necessary.
> 	(prev_cc0_setter): Likewise.
OK.
jeff
diff mbox

Patch

diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 042694a..b64b276 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3437,20 +3437,20 @@  prev_active_insn (rtx insn)
 
    Return 0 if we can't find the insn.  */
 
-rtx
+rtx_insn *
 next_cc0_user (rtx insn)
 {
   rtx note = find_reg_note (insn, REG_CC_USER, NULL_RTX);
 
   if (note)
-    return XEXP (note, 0);
+    return as_a_nullable <rtx_insn *> (XEXP (note, 0));
 
   insn = next_nonnote_insn (insn);
   if (insn && NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
     insn = XVECEXP (PATTERN (insn), 0, 0);
 
   if (insn && INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
-    return insn;
+    return as_a_nullable <rtx_insn *> (insn);
 
   return 0;
 }
@@ -3458,18 +3458,18 @@  next_cc0_user (rtx insn)
 /* Find the insn that set CC0 for INSN.  Unless INSN has a REG_CC_SETTER
    note, it is the previous insn.  */
 
-rtx
+rtx_insn *
 prev_cc0_setter (rtx insn)
 {
   rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
 
   if (note)
-    return XEXP (note, 0);
+    return as_a_nullable <rtx_insn *> (XEXP (note, 0));
 
   insn = prev_nonnote_insn (insn);
   gcc_assert (sets_cc0_p (PATTERN (insn)));
 
-  return insn;
+  return as_a_nullable <rtx_insn *> (insn);
 }
 #endif
 
diff --git a/gcc/rtl.h b/gcc/rtl.h
index d519908..b4027aa 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2418,8 +2418,8 @@  extern rtx_insn *next_real_insn (rtx);
 extern rtx_insn *prev_active_insn (rtx);
 extern rtx_insn *next_active_insn (rtx);
 extern int active_insn_p (const_rtx);
-extern rtx next_cc0_user (rtx);
-extern rtx prev_cc0_setter (rtx);
+extern rtx_insn *next_cc0_user (rtx);
+extern rtx_insn *prev_cc0_setter (rtx);
 
 /* In emit-rtl.c  */
 extern int insn_line (const_rtx);