Commit 981ac3c7 by David Malcolm Committed by David Malcolm

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
parent 7dcc3ab5
2014-08-19 David Malcolm <dmalcolm@redhat.com> 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 * rtl.h (gen_label_rtx): Strengthen return type from rtx to
rtx_code_label *. rtx_code_label *.
......
...@@ -77,10 +77,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool); ...@@ -77,10 +77,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool);
/* Return the first insn of the current sequence or current function. */ /* Return the first insn of the current sequence or current function. */
static inline rtx static inline rtx_insn *
get_insns (void) 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. */ /* Specify a new insn as the first in the chain. */
...@@ -94,10 +95,11 @@ set_first_insn (rtx insn) ...@@ -94,10 +95,11 @@ set_first_insn (rtx insn)
/* Return the last insn emitted in current sequence or current function. */ /* Return the last insn emitted in current sequence or current function. */
static inline rtx static inline rtx_insn *
get_last_insn (void) 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. */ /* Specify a new insn as the last in the chain. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment