From 61cfce81e4e53110b748736a8822f24dcd189709 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 31 Dec 2013 04:44:06 -0500
Subject: [PATCH 036/159] FIXME: return types of the various emit_ functions

---
 gcc/emit-rtl.c | 89 +++++++++++++++++++++++++++++-----------------------------
 gcc/emit-rtl.h |  2 +-
 gcc/rtl.h      | 50 ++++++++++++++++-----------------
 3 files changed, 71 insertions(+), 70 deletions(-)

diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 0b9a1ad..6a90c42 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -4259,7 +4259,7 @@ emit_jump_insn_before_noloc (rtx x, rtx before)
 /* Make an instruction with body X and code CALL_INSN
    and output it before the instruction BEFORE.  */
 
-rtx
+rtx_base_insn
 emit_call_insn_before_noloc (rtx x, rtx before)
 {
   return emit_pattern_before_noloc (x, before, NULL_RTX, NULL,
@@ -4269,7 +4269,7 @@ emit_call_insn_before_noloc (rtx x, rtx before)
 /* Make an instruction with body X and code DEBUG_INSN
    and output it before the instruction BEFORE.  */
 
-rtx
+rtx_base_insn
 emit_debug_insn_before_noloc (rtx x, rtx before)
 {
   return emit_pattern_before_noloc (x, before, NULL_RTX, NULL,
@@ -4279,10 +4279,10 @@ emit_debug_insn_before_noloc (rtx x, rtx before)
 /* Make an insn of code BARRIER
    and output it before the insn BEFORE.  */
 
-rtx
+rtx_base_insn
 emit_barrier_before (rtx before)
 {
-  rtx insn = rtx_alloc (BARRIER);
+  rtx_base_insn insn = rtx_alloc (BARRIER)->as_an_rtx_base_insn ();
 
   INSN_UID (insn) = cur_insn_uid++;
 
@@ -4292,8 +4292,8 @@ emit_barrier_before (rtx before)
 
 /* Emit the label LABEL before the insn BEFORE.  */
 
-rtx
-emit_label_before (rtx label, rtx before)
+rtx_code_label
+emit_label_before (rtx_code_label label, rtx before)
 {
   gcc_checking_assert (INSN_UID (label) == 0);
   INSN_UID (label) = cur_insn_uid++;
@@ -4412,7 +4412,7 @@ emit_jump_insn_after_noloc (rtx x, rtx after)
 /* Make an instruction with body X and code CALL_INSN
    and output it after the instruction AFTER.  */
 
-rtx
+rtx_base_insn
 emit_call_insn_after_noloc (rtx x, rtx after)
 {
   return emit_pattern_after_noloc (x, after, NULL, make_call_insn_raw);
@@ -4421,7 +4421,7 @@ emit_call_insn_after_noloc (rtx x, rtx after)
 /* Make an instruction with body X and code CALL_INSN
    and output it after the instruction AFTER.  */
 
-rtx
+rtx_base_insn
 emit_debug_insn_after_noloc (rtx x, rtx after)
 {
   return emit_pattern_after_noloc (x, after, NULL, make_debug_insn_raw);
@@ -4430,10 +4430,10 @@ emit_debug_insn_after_noloc (rtx x, rtx after)
 /* Make an insn of code BARRIER
    and output it after the insn AFTER.  */
 
-rtx
+rtx_base_insn
 emit_barrier_after (rtx after)
 {
-  rtx insn = rtx_alloc (BARRIER);
+  rtx_base_insn insn = rtx_alloc (BARRIER)->as_an_rtx_base_insn ();
 
   INSN_UID (insn) = cur_insn_uid++;
 
@@ -4443,8 +4443,8 @@ emit_barrier_after (rtx after)
 
 /* Emit the label LABEL after the insn AFTER.  */
 
-rtx
-emit_label_after (rtx label, rtx after)
+rtx_code_label
+emit_label_after (rtx_code_label label, rtx after)
 {
   gcc_checking_assert (INSN_UID (label) == 0);
   INSN_UID (label) = cur_insn_uid++;
@@ -4593,28 +4593,28 @@ emit_jump_insn_after (rtx pattern, rtx after)
 }
 
 /* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to LOC.  */
-rtx
+rtx_base_insn
 emit_call_insn_after_setloc (rtx pattern, rtx after, int loc)
 {
   return emit_pattern_after_setloc (pattern, after, loc, make_call_insn_raw);
 }
 
 /* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to AFTER.  */
-rtx
+rtx_base_insn
 emit_call_insn_after (rtx pattern, rtx after)
 {
   return emit_pattern_after (pattern, after, true, make_call_insn_raw);
 }
 
 /* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to LOC.  */
-rtx
+rtx_base_insn
 emit_debug_insn_after_setloc (rtx pattern, rtx after, int loc)
 {
   return emit_pattern_after_setloc (pattern, after, loc, make_debug_insn_raw);
 }
 
 /* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to AFTER.  */
-rtx
+rtx_base_insn
 emit_debug_insn_after (rtx pattern, rtx after)
 {
   return emit_pattern_after (pattern, after, false, make_debug_insn_raw);
@@ -4710,7 +4710,7 @@ emit_jump_insn_before (rtx pattern, rtx before)
 }
 
 /* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC.  */
-rtx
+rtx_base_insn
 emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
 {
   return emit_pattern_before_setloc (pattern, before, loc, false,
@@ -4719,7 +4719,7 @@ emit_call_insn_before_setloc (rtx pattern, rtx before, int loc)
 
 /* Like emit_call_insn_before_noloc,
    but set insn_location according to BEFORE.  */
-rtx
+rtx_base_insn
 emit_call_insn_before (rtx pattern, rtx before)
 {
   return emit_pattern_before (pattern, before, true, false,
@@ -4727,7 +4727,7 @@ emit_call_insn_before (rtx pattern, rtx before)
 }
 
 /* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC.  */
-rtx
+rtx_base_insn
 emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
 {
   return emit_pattern_before_setloc (pattern, before, loc, false,
@@ -4736,7 +4736,7 @@ emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc)
 
 /* Like emit_debug_insn_before_noloc,
    but set insn_location according to BEFORE.  */
-rtx
+rtx_base_insn
 emit_debug_insn_before (rtx pattern, rtx before)
 {
   return emit_pattern_before (pattern, before, false, false,
@@ -4795,11 +4795,11 @@ emit_insn (rtx x)
 /* Make an insn of code DEBUG_INSN with pattern X
    and add it to the end of the doubly-linked list.  */
 
-rtx
+rtx_base_insn
 emit_debug_insn (rtx x)
 {
-  rtx last = get_last_insn ();
-  rtx insn;
+  rtx_base_insn last = get_last_insn ();
+  rtx_base_insn insn;
 
   if (x == NULL_RTX)
     return last;
@@ -4813,10 +4813,10 @@ emit_debug_insn (rtx x)
     case CODE_LABEL:
     case BARRIER:
     case NOTE:
-      insn = x;
+      insn = x->as_an_rtx_base_insn ();
       while (insn)
 	{
-	  rtx next = NEXT_INSN (insn);
+	  rtx_base_insn next = NEXT_INSN (insn);
 	  add_insn (insn);
 	  last = insn;
 	  insn = next;
@@ -4842,10 +4842,10 @@ emit_debug_insn (rtx x)
 /* Make an insn of code JUMP_INSN with pattern X
    and add it to the end of the doubly-linked list.  */
 
-rtx
+rtx_base_insn
 emit_jump_insn (rtx x)
 {
-  rtx last = NULL_RTX, insn;
+  rtx_base_insn last = NULL_RTX_BASE_INSN, insn;
 
   switch (GET_CODE (x))
     {
@@ -4856,10 +4856,10 @@ emit_jump_insn (rtx x)
     case CODE_LABEL:
     case BARRIER:
     case NOTE:
-      insn = x;
+      insn = x->as_an_rtx_base_insn ();
       while (insn)
 	{
-	  rtx next = NEXT_INSN (insn);
+	  rtx_base_insn next = NEXT_INSN (insn);
 	  add_insn (insn);
 	  last = insn;
 	  insn = next;
@@ -4885,10 +4885,10 @@ emit_jump_insn (rtx x)
 /* Make an insn of code CALL_INSN with pattern X
    and add it to the end of the doubly-linked list.  */
 
-rtx
+rtx_base_insn
 emit_call_insn (rtx x)
 {
-  rtx insn;
+  rtx_base_insn insn;
 
   switch (GET_CODE (x))
     {
@@ -4947,10 +4947,10 @@ emit_jump_table_data (rtx table)
 /* Make an insn of code BARRIER
    and add it to the end of the doubly-linked list.  */
 
-rtx
+rtx_base_insn
 emit_barrier (void)
 {
-  rtx barrier = rtx_alloc (BARRIER);
+  rtx_base_insn barrier = rtx_alloc (BARRIER)->as_an_rtx_base_insn ();
   INSN_UID (barrier) = cur_insn_uid++;
   add_insn (barrier);
   return barrier;
@@ -4981,7 +4981,7 @@ emit_note (enum insn_note kind)
 
 /* Emit a clobber of lvalue X.  */
 
-rtx
+rtx_base_insn
 emit_clobber (rtx x)
 {
   /* CONCATs should not appear in the insn stream.  */
@@ -4995,10 +4995,10 @@ emit_clobber (rtx x)
 
 /* Return a sequence of insns to clobber lvalue X.  */
 
-rtx
+rtx_base_insn
 gen_clobber (rtx x)
 {
-  rtx seq;
+  rtx_base_insn seq;
 
   start_sequence ();
   emit_clobber (x);
@@ -5009,7 +5009,7 @@ gen_clobber (rtx x)
 
 /* Emit a use of rvalue X.  */
 
-rtx
+rtx_base_insn
 emit_use (rtx x)
 {
   /* CONCATs should not appear in the insn stream.  */
@@ -5023,10 +5023,10 @@ emit_use (rtx x)
 
 /* Return a sequence of insns to use rvalue X.  */
 
-rtx
+rtx_base_insn
 gen_use (rtx x)
 {
-  rtx seq;
+  rtx_base_insn seq;
 
   start_sequence ();
   emit_use (x);
@@ -5145,7 +5145,7 @@ classify_insn (rtx x)
 /* Emit the rtl pattern X as an appropriate kind of insn.
    If X is a label, it is simply added into the insn chain.  */
 
-rtx
+rtx_base_insn
 emit (rtx x)
 {
   enum rtx_code code = classify_insn (x);
@@ -5158,7 +5158,7 @@ emit (rtx x)
       return emit_insn (x);
     case  JUMP_INSN:
       {
-	rtx insn = emit_jump_insn (x);
+	rtx_base_insn insn = emit_jump_insn (x);
 	if (any_uncondjump_p (insn) || GET_CODE (x) == RETURN)
 	  return emit_barrier ();
 	return insn;
@@ -5965,10 +5965,11 @@ init_emit_once (void)
 /* Produce exact duplicate of insn INSN after AFTER.
    Care updating of libcall regions if present.  */
 
-rtx
-emit_copy_of_insn_after (rtx insn, rtx after)
+rtx_base_insn
+emit_copy_of_insn_after (rtx insn, rtx_base_insn after)
 {
-  rtx new_rtx, link;
+  rtx_base_insn new_rtx;
+  rtx link;
 
   switch (GET_CODE (insn))
     {
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index baa6464..d1a435a 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -63,7 +63,7 @@ extern rtx copy_insn_1 (rtx);
 extern rtx copy_insn (rtx);
 extern rtx_base_insn copy_delay_slot_insn (rtx_base_insn);
 extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
-extern rtx emit_copy_of_insn_after (rtx, rtx);
+extern rtx_base_insn emit_copy_of_insn_after (rtx, rtx_base_insn);
 extern void set_reg_attrs_from_value (rtx, rtx);
 extern void set_reg_attrs_for_parm (rtx, rtx);
 extern void set_reg_attrs_for_decl_rtl (tree t, rtx x);
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 81e29d6..11dbb16 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2125,14 +2125,14 @@ extern rtx_base_insn emit_insn_before_setloc (rtx, rtx, int);
 extern rtx_jump_insn emit_jump_insn_before (rtx, rtx);
 extern rtx_jump_insn emit_jump_insn_before_noloc (rtx, rtx);
 extern rtx_jump_insn emit_jump_insn_before_setloc (rtx, rtx, int);
-extern rtx emit_call_insn_before (rtx, rtx);
-extern rtx emit_call_insn_before_noloc (rtx, rtx);
-extern rtx emit_call_insn_before_setloc (rtx, rtx, int);
-extern rtx emit_debug_insn_before (rtx, rtx);
-extern rtx emit_debug_insn_before_noloc (rtx, rtx);
-extern rtx emit_debug_insn_before_setloc (rtx, rtx, int);
-extern rtx emit_barrier_before (rtx);
-extern rtx emit_label_before (rtx, rtx);
+extern rtx_base_insn emit_call_insn_before (rtx, rtx);
+extern rtx_base_insn emit_call_insn_before_noloc (rtx, rtx);
+extern rtx_base_insn emit_call_insn_before_setloc (rtx, rtx, int);
+extern rtx_base_insn emit_debug_insn_before (rtx, rtx);
+extern rtx_base_insn emit_debug_insn_before_noloc (rtx, rtx);
+extern rtx_base_insn emit_debug_insn_before_setloc (rtx, rtx, int);
+extern rtx_base_insn emit_barrier_before (rtx);
+extern rtx_code_label emit_label_before (rtx_code_label, rtx);
 extern rtx_note emit_note_before (enum insn_note, rtx);
 extern rtx_base_insn emit_insn_after (rtx, rtx);
 extern rtx_base_insn emit_insn_after_noloc (rtx, rtx, basic_block);
@@ -2140,28 +2140,28 @@ extern rtx_base_insn emit_insn_after_setloc (rtx, rtx, int);
 extern rtx_jump_insn emit_jump_insn_after (rtx, rtx);
 extern rtx_jump_insn emit_jump_insn_after_noloc (rtx, rtx);
 extern rtx_jump_insn emit_jump_insn_after_setloc (rtx, rtx, int);
-extern rtx emit_call_insn_after (rtx, rtx);
-extern rtx emit_call_insn_after_noloc (rtx, rtx);
-extern rtx emit_call_insn_after_setloc (rtx, rtx, int);
-extern rtx emit_debug_insn_after (rtx, rtx);
-extern rtx emit_debug_insn_after_noloc (rtx, rtx);
-extern rtx emit_debug_insn_after_setloc (rtx, rtx, int);
-extern rtx emit_barrier_after (rtx);
-extern rtx emit_label_after (rtx, rtx);
+extern rtx_base_insn emit_call_insn_after (rtx, rtx);
+extern rtx_base_insn emit_call_insn_after_noloc (rtx, rtx);
+extern rtx_base_insn emit_call_insn_after_setloc (rtx, rtx, int);
+extern rtx_base_insn emit_debug_insn_after (rtx, rtx);
+extern rtx_base_insn emit_debug_insn_after_noloc (rtx, rtx);
+extern rtx_base_insn emit_debug_insn_after_setloc (rtx, rtx, int);
+extern rtx_base_insn emit_barrier_after (rtx);
+extern rtx_code_label emit_label_after (rtx_code_label, rtx);
 extern rtx_note emit_note_after (enum insn_note, rtx);
 extern rtx_base_insn emit_insn (rtx);
-extern rtx emit_debug_insn (rtx);
-extern rtx emit_jump_insn (rtx);
-extern rtx emit_call_insn (rtx);
+extern rtx_base_insn emit_debug_insn (rtx);
+extern rtx_base_insn emit_jump_insn (rtx);
+extern rtx_base_insn emit_call_insn (rtx);
 extern rtx_base_insn emit_label (rtx_base_insn);
 extern rtx_jump_table_data emit_jump_table_data (rtx);
-extern rtx emit_barrier (void);
+extern rtx_base_insn emit_barrier (void);
 extern rtx_note emit_note (enum insn_note);
 extern rtx_note emit_note_copy (rtx_note);
-extern rtx gen_clobber (rtx);
-extern rtx emit_clobber (rtx);
-extern rtx gen_use (rtx);
-extern rtx emit_use (rtx);
+extern rtx_base_insn gen_clobber (rtx);
+extern rtx_base_insn emit_clobber (rtx);
+extern rtx_base_insn gen_use (rtx);
+extern rtx_base_insn emit_use (rtx);
 extern rtx_base_insn make_insn_raw (rtx);
 extern void add_function_usage_to (rtx, rtx);
 extern rtx_call_insn last_call_insn (void);
@@ -2823,7 +2823,7 @@ extern void add_insn (rtx);
 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 emit (rtx);
+extern rtx_base_insn emit (rtx);
 extern void delete_insn (rtx);
 extern rtx entry_of_function (void);
 extern void emit_insn_at_entry (rtx);
-- 
1.7.11.7

