Commit 167b9fae by David Malcolm Committed by David Malcolm

make_insn_raw returns an rtx_insn

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
parent 049cfc4a
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
rtx_call_insn *.
* rtl.h (is_a_helper <rtx_call_insn *>::test): New overload,
......
......@@ -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;
......
......@@ -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);
......
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