]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Return rtx_insn from get_insns/get_last_insn
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 19 Aug 2014 18:24:21 +0000 (18:24 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 19 Aug 2014 18:24:21 +0000 (18:24 +0000)
2014-08-19  David Malcolm  <dmalcolm@redhat.com>

* emit-rtl.h (get_insns): Strengthen return type from rtx to
rtx_insn *, adding a checked cast for now.
(get_last_insn): Likewise.

From-SVN: r214180

gcc/ChangeLog
gcc/emit-rtl.h

index 8c472a8277a56e910e979e6e7d937e5f77241dec..d86b78b2bc9a189c5b452f1a60421dd6b0e9deb4 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-19  David Malcolm  <dmalcolm@redhat.com>
+
+       * emit-rtl.h (get_insns): Strengthen return type from rtx to
+       rtx_insn *, adding a checked cast for now.
+       (get_last_insn): Likewise.
+
 2014-08-19  David Malcolm  <dmalcolm@redhat.com>
 
        * rtl.h (gen_label_rtx): Strengthen return type from rtx to
index 8439750416b7b41702c7d45c5898b776755dcb4c..e97e0cbfd5c40cd91a7347188885d01dd6eccb19 100644 (file)
@@ -77,10 +77,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool);
 
 /* Return the first insn of the current sequence or current function.  */
 
-static inline rtx
+static inline rtx_insn *
 get_insns (void)
 {
-  return crtl->emit.x_first_insn;
+  rtx insn = crtl->emit.x_first_insn;
+  return safe_as_a <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the first in the chain.  */
@@ -94,10 +95,11 @@ set_first_insn (rtx insn)
 
 /* Return the last insn emitted in current sequence or current function.  */
 
-static inline rtx
+static inline rtx_insn *
 get_last_insn (void)
 {
-  return crtl->emit.x_last_insn;
+  rtx insn = crtl->emit.x_last_insn;
+  return safe_as_a <rtx_insn *> (insn);
 }
 
 /* Specify a new insn as the last in the chain.  */