]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
make_insn_raw returns an rtx_insn
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 19 Aug 2014 19:38:12 +0000 (19:38 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 19 Aug 2014 19:38:12 +0000 (19:38 +0000)
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

* rtl.h (make_insn_raw): Strengthen return type from rtx to
rtx_insn *.

* emit-rtl.c (make_insn_raw): Strengthen return type and local
"insn" from rtx to rtx_insn *.
(make_debug_insn_raw): Strengthen return type from rtx to
rtx_insn *; strengthen local "insn" from rtx to rtx_debug_insn *.
(make_jump_insn_raw):  Strengthen return type from rtx to
rtx_insn *; strengthen local "insn" from rtx to rtx_jump_insn *.
(make_call_insn_raw):  Strengthen return type from rtx to
rtx_insn *; strengthen local "insn" from rtx to rtx_call_insn *.
(emit_pattern_before_noloc): Strengthen return type of "make_raw"
callback from rtx to rtx_insn *; likewise for local "insn" and
"next", adding a checked cast to rtx_insn in the relevant cases of
the switch statement.
(emit_pattern_after_noloc): Strengthen return type of "make_raw"
callback from rtx to rtx_insn *.
(emit_pattern_after_setloc): Likewise.
(emit_pattern_after): Likewise.
(emit_pattern_before_setloc): Likewise.
(emit_pattern_before): Likewise.

From-SVN: r214187

gcc/ChangeLog
gcc/emit-rtl.c
gcc/rtl.h

index d6c75e5d46f7058a266db1e55965d4a3fbd7f702..3b92fbf46ca77e291b65293cf07f6674c84b738a 100644 (file)
@@ -1,3 +1,27 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * rtl.h (make_insn_raw): Strengthen return type from rtx to
+       rtx_insn *.
+
+       * emit-rtl.c (make_insn_raw): Strengthen return type and local
+       "insn" from rtx to rtx_insn *.
+       (make_debug_insn_raw): Strengthen return type from rtx to
+       rtx_insn *; strengthen local "insn" from rtx to rtx_debug_insn *.
+       (make_jump_insn_raw):  Strengthen return type from rtx to
+       rtx_insn *; strengthen local "insn" from rtx to rtx_jump_insn *.
+       (make_call_insn_raw):  Strengthen return type from rtx to
+       rtx_insn *; strengthen local "insn" from rtx to rtx_call_insn *.
+       (emit_pattern_before_noloc): Strengthen return type of "make_raw"
+       callback from rtx to rtx_insn *; likewise for local "insn" and
+       "next", adding a checked cast to rtx_insn in the relevant cases of
+       the switch statement.
+       (emit_pattern_after_noloc): Strengthen return type of "make_raw"
+       callback from rtx to rtx_insn *.
+       (emit_pattern_after_setloc): Likewise.
+       (emit_pattern_after): Likewise.
+       (emit_pattern_before_setloc): Likewise.
+       (emit_pattern_before): Likewise.
+
 2014-08-19  David Malcolm  <dmalcolm@redhat.com>
 
        * emit-rtl.c (last_call_insn): Strengthen return type from rtx to
index 5b68b1edc96042276f677a8911cabfa113b6d173..218ddc470ea5bba157016b33ebec0d7ef480273e 100644 (file)
@@ -3760,12 +3760,12 @@ try_split (rtx pat, rtx trial, int last)
 /* Make and return an INSN rtx, initializing all its slots.
    Store PATTERN in the pattern slots.  */
 
-rtx
+rtx_insn *
 make_insn_raw (rtx pattern)
 {
-  rtx insn;
+  rtx_insn *insn;
 
-  insn = rtx_alloc (INSN);
+  insn = as_a <rtx_insn *> (rtx_alloc (INSN));
 
   INSN_UID (insn) = cur_insn_uid++;
   PATTERN (insn) = pattern;
@@ -3791,12 +3791,12 @@ make_insn_raw (rtx pattern)
 
 /* Like `make_insn_raw' but make a DEBUG_INSN instead of an insn.  */
 
-static rtx
+static rtx_insn *
 make_debug_insn_raw (rtx pattern)
 {
-  rtx insn;
+  rtx_debug_insn *insn;
 
-  insn = rtx_alloc (DEBUG_INSN);
+  insn = as_a <rtx_debug_insn *> (rtx_alloc (DEBUG_INSN));
   INSN_UID (insn) = cur_debug_insn_uid++;
   if (cur_debug_insn_uid > MIN_NONDEBUG_INSN_UID)
     INSN_UID (insn) = cur_insn_uid++;
@@ -3812,12 +3812,12 @@ make_debug_insn_raw (rtx pattern)
 
 /* Like `make_insn_raw' but make a JUMP_INSN instead of an insn.  */
 
-static rtx
+static rtx_insn *
 make_jump_insn_raw (rtx pattern)
 {
-  rtx insn;
+  rtx_jump_insn *insn;
 
-  insn = rtx_alloc (JUMP_INSN);
+  insn = as_a <rtx_jump_insn *> (rtx_alloc (JUMP_INSN));
   INSN_UID (insn) = cur_insn_uid++;
 
   PATTERN (insn) = pattern;
@@ -3832,12 +3832,12 @@ make_jump_insn_raw (rtx pattern)
 
 /* Like `make_insn_raw' but make a CALL_INSN instead of an insn.  */
 
-static rtx
+static rtx_insn *
 make_call_insn_raw (rtx pattern)
 {
-  rtx insn;
+  rtx_call_insn *insn;
 
-  insn = rtx_alloc (CALL_INSN);
+  insn = as_a <rtx_call_insn *> (rtx_alloc (CALL_INSN));
   INSN_UID (insn) = cur_insn_uid++;
 
   PATTERN (insn) = pattern;
@@ -4271,9 +4271,9 @@ reorder_insns (rtx from, rtx to, rtx after)
 
 static rtx
 emit_pattern_before_noloc (rtx x, rtx before, rtx last, basic_block bb,
-                           rtx (*make_raw) (rtx))
+                           rtx_insn *(*make_raw) (rtx))
 {
-  rtx insn;
+  rtx_insn *insn;
 
   gcc_assert (before);
 
@@ -4289,10 +4289,10 @@ emit_pattern_before_noloc (rtx x, rtx before, rtx last, basic_block bb,
     case CODE_LABEL:
     case BARRIER:
     case NOTE:
-      insn = x;
+      insn = as_a <rtx_insn *> (x);
       while (insn)
        {
-         rtx next = NEXT_INSN (insn);
+         rtx_insn *next = NEXT_INSN (insn);
          add_insn_before (insn, before, bb);
          last = insn;
          insn = next;
@@ -4425,7 +4425,7 @@ emit_insn_after_1 (rtx first, rtx after, basic_block bb)
 
 static rtx
 emit_pattern_after_noloc (rtx x, rtx after, basic_block bb,
-                         rtx (*make_raw)(rtx))
+                         rtx_insn *(*make_raw)(rtx))
 {
   rtx last = after;
 
@@ -4592,7 +4592,7 @@ emit_note_before (enum insn_note subtype, rtx before)
 
 static rtx
 emit_pattern_after_setloc (rtx pattern, rtx after, int loc,
-                          rtx (*make_raw) (rtx))
+                          rtx_insn *(*make_raw) (rtx))
 {
   rtx last = emit_pattern_after_noloc (pattern, after, NULL, make_raw);
 
@@ -4617,7 +4617,7 @@ emit_pattern_after_setloc (rtx pattern, rtx after, int loc,
 
 static rtx
 emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns,
-                   rtx (*make_raw) (rtx))
+                   rtx_insn *(*make_raw) (rtx))
 {
   rtx prev = after;
 
@@ -4695,7 +4695,7 @@ emit_debug_insn_after (rtx pattern, rtx after)
 
 static rtx
 emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp,
-                           rtx (*make_raw) (rtx))
+                           rtx_insn *(*make_raw) (rtx))
 {
   rtx first = PREV_INSN (before);
   rtx last = emit_pattern_before_noloc (pattern, before,
@@ -4727,7 +4727,7 @@ emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp,
 
 static rtx
 emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns,
-                    bool insnp, rtx (*make_raw) (rtx))
+                    bool insnp, rtx_insn *(*make_raw) (rtx))
 {
   rtx next = before;
 
index fea663797e3cf5fe882fc20644521581a367be13..8426b91451aeb1e96799c6289797c84720a254d4 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2422,7 +2422,7 @@ extern rtx gen_clobber (rtx);
 extern rtx emit_clobber (rtx);
 extern rtx gen_use (rtx);
 extern rtx emit_use (rtx);
-extern rtx make_insn_raw (rtx);
+extern rtx_insn *make_insn_raw (rtx);
 extern void add_function_usage_to (rtx, rtx);
 extern rtx_call_insn *last_call_insn (void);
 extern rtx_insn *previous_insn (rtx);