This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 020/236] Return rtx_insn from get_insns/get_last_insn
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Wed, 6 Aug 2014 13:19:59 -0400
- Subject: [PATCH 020/236] Return rtx_insn from get_insns/get_last_insn
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com>
Ultimately, the underlying fields should become rtx_insn *, but for now we
can do this with a checked cast.
Note to self:
config/m32c/m32c.c: m32c_leaf_function_p directly manipulates
x_first_insn and x_last_insn, using sequence_stack.
gcc/
* emit-rtl.h (get_insns): Strengthen return type from rtx to
rtx_insn *, adding a checked cast for now.
(get_last_insn): Likewise.
---
gcc/emit-rtl.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index c72c24f..f97ac49 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -74,10 +74,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 as_a_nullable <rtx_insn *> (insn);
}
/* Specify a new insn as the first in the chain. */
@@ -91,10 +92,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 as_a_nullable <rtx_insn *> (insn);
}
/* Specify a new insn as the last in the chain. */
--
1.8.5.3