aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-08-19 18:24:21 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-08-19 18:24:21 +0000
commit981ac3c795ed23053c0a82d01d8d3158429a547f (patch)
tree027256b48c5fed3ba51c729ba3c322cf1b89e3f1
parent7dcc3ab587749e9898da60baef6f9c9d43a5626d (diff)
downloadgcc-981ac3c795ed23053c0a82d01d8d3158429a547f.zip
gcc-981ac3c795ed23053c0a82d01d8d3158429a547f.tar.gz
gcc-981ac3c795ed23053c0a82d01d8d3158429a547f.tar.bz2
Return rtx_insn from get_insns/get_last_insn
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/emit-rtl.h10
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c472a8..d86b78b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
rtx_code_label *.
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index 8439750..e97e0cb 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -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. */