From cd459bf87c0662db04a840f15d2e914f1ae536fa Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 Aug 2014 20:36:20 +0000 Subject: [PATCH] emit_* functions return rtx_insn 2014-08-19 David Malcolm * emit-rtl.h (emit_copy_of_insn_after): Strengthen return type from rtx to rtx_insn *. * rtl.h (emit_insn_before): Likewise. (emit_insn_before_noloc): Likewise. (emit_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_jump_insn_before_noloc): Likewise. (emit_jump_insn_before_setloc): Likewise. (emit_call_insn_before): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_call_insn_before_setloc): Likewise. (emit_debug_insn_before): Likewise. (emit_debug_insn_before_noloc): Likewise. (emit_debug_insn_before_setloc): Likewise. (emit_label_before): Likewise. (emit_insn_after): Likewise. (emit_insn_after_noloc): Likewise. (emit_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_call_insn_after): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_call_insn_after_setloc): Likewise. (emit_debug_insn_after): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_debug_insn_after_setloc): Likewise. (emit_label_after): Likewise. (emit_insn): Likewise. (emit_debug_insn): Likewise. (emit_jump_insn): Likewise. (emit_call_insn): Likewise. (emit_label): Likewise. (gen_clobber): Likewise. (emit_clobber): Likewise. (gen_use): Likewise. (emit_use): Likewise. (emit): Likewise. (emit_barrier_before): Strengthen return type from rtx to rtx_barrier *. (emit_barrier_after): Likewise. (emit_barrier): Likewise. * emit-rtl.c (emit_pattern_before_noloc): Strengthen return type from rtx to rtx_insn *. Add checked casts for now when converting "last" from rtx to rtx_insn *. (emit_insn_before_noloc): Likewise for return type. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): Likewise. (emit_barrier_before): Strengthen return type and local "insn" from rtx to rtx_barrier *. (emit_label_before): Strengthen return type from rtx to rtx_insn *. Add checked cast for now when returning param (emit_pattern_after_noloc): Strengthen return type from rtx to rtx_insn *. Add checked casts for now when converting "last" from rtx to rtx_insn *. (emit_insn_after_noloc): Strengthen return type from rtx to rtx_insn *. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_barrier_after): Strengthen return type from rtx to rtx_barrier *. (emit_label_after): Strengthen return type from rtx to rtx_insn *. Add checked cast for now when converting "label" from rtx to rtx_insn *. (emit_pattern_after_setloc): Strengthen return type from rtx to rtx_insn *. Add checked casts for now when converting "last" from rtx to rtx_insn *. (emit_pattern_after): Strengthen return type from rtx to rtx_insn *. (emit_insn_after_setloc): Likewise. (emit_insn_after): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise. (emit_call_insn_after_setloc): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): Likewise. (emit_debug_insn_after): Likewise. (emit_pattern_before_setloc): Likewise. Add checked casts for now when converting "last" from rtx to rtx_insn *. (emit_pattern_before): Strengthen return type from rtx to rtx_insn *. (emit_insn_before_setloc): Likewise. (emit_insn_before): Likewise. (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_call_insn_before_setloc): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): Likewise. (emit_debug_insn_before): Likewise. (emit_insn): Strengthen return type and locals "last", "insn", "next" from rtx to rtx_insn *. Add checked cast to rtx_insn within cases where we know we have an insn. (emit_debug_insn): Likewise. (emit_jump_insn): Likewise. (emit_call_insn): Strengthen return type and local "insn" from rtx to rtx_insn *. (emit_label): Strengthen return type from rtx to rtx_insn *. Add a checked cast to rtx_insn * for now on "label". (emit_barrier): Strengthen return type from rtx to rtx_barrier *. (emit_clobber): Strengthen return type from rtx to rtx_insn *. (emit_use): Likewise. (gen_use): Likewise, also for local "seq". (emit): Likewise for return type and local "insn". (rtx_insn): Likewise for return type and local "new_rtx". * cfgrtl.c (emit_barrier_after_bb): Strengthen local "barrier" from rtx to rtx_barrier *. * config/sh/sh.c (output_stack_adjust): Since emit_insn has changed return type from rtx to rtx_insn *, we must update "emit_fn" type, and this in turn means updating... (frame_insn): ...this. Strengthen return type from rtx to rtx_insn *. Introduce a new local "insn" of the appropriate type. From-SVN: r214194 --- gcc/ChangeLog | 121 +++++++++++++++++++++++++++++++++++++++++ gcc/cfgrtl.c | 2 +- gcc/config/sh/sh.c | 12 ++--- gcc/emit-rtl.c | 154 +++++++++++++++++++++++++++-------------------------- gcc/emit-rtl.h | 2 +- gcc/rtl.h | 78 +++++++++++++-------------- 6 files changed, 246 insertions(+), 123 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 403edb9..f5e79a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,126 @@ 2014-08-19 David Malcolm + * emit-rtl.h (emit_copy_of_insn_after): Strengthen return type + from rtx to rtx_insn *. + + * rtl.h (emit_insn_before): Likewise. + (emit_insn_before_noloc): Likewise. + (emit_insn_before_setloc): Likewise. + (emit_jump_insn_before): Likewise. + (emit_jump_insn_before_noloc): Likewise. + (emit_jump_insn_before_setloc): Likewise. + (emit_call_insn_before): Likewise. + (emit_call_insn_before_noloc): Likewise. + (emit_call_insn_before_setloc): Likewise. + (emit_debug_insn_before): Likewise. + (emit_debug_insn_before_noloc): Likewise. + (emit_debug_insn_before_setloc): Likewise. + (emit_label_before): Likewise. + (emit_insn_after): Likewise. + (emit_insn_after_noloc): Likewise. + (emit_insn_after_setloc): Likewise. + (emit_jump_insn_after): Likewise. + (emit_jump_insn_after_noloc): Likewise. + (emit_jump_insn_after_setloc): Likewise. + (emit_call_insn_after): Likewise. + (emit_call_insn_after_noloc): Likewise. + (emit_call_insn_after_setloc): Likewise. + (emit_debug_insn_after): Likewise. + (emit_debug_insn_after_noloc): Likewise. + (emit_debug_insn_after_setloc): Likewise. + (emit_label_after): Likewise. + (emit_insn): Likewise. + (emit_debug_insn): Likewise. + (emit_jump_insn): Likewise. + (emit_call_insn): Likewise. + (emit_label): Likewise. + (gen_clobber): Likewise. + (emit_clobber): Likewise. + (gen_use): Likewise. + (emit_use): Likewise. + (emit): Likewise. + + (emit_barrier_before): Strengthen return type from rtx to + rtx_barrier *. + (emit_barrier_after): Likewise. + (emit_barrier): Likewise. + + * emit-rtl.c (emit_pattern_before_noloc): Strengthen return type + from rtx to rtx_insn *. Add checked casts for now when converting + "last" from rtx to rtx_insn *. + (emit_insn_before_noloc): Likewise for return type. + (emit_jump_insn_before_noloc): Likewise. + (emit_call_insn_before_noloc): Likewise. + (emit_debug_insn_before_noloc): Likewise. + (emit_barrier_before): Strengthen return type and local "insn" + from rtx to rtx_barrier *. + (emit_label_before): Strengthen return type from rtx to + rtx_insn *. Add checked cast for now when returning param + (emit_pattern_after_noloc): Strengthen return type from rtx to + rtx_insn *. Add checked casts for now when converting "last" from + rtx to rtx_insn *. + (emit_insn_after_noloc): Strengthen return type from rtx to + rtx_insn *. + (emit_jump_insn_after_noloc): Likewise. + (emit_call_insn_after_noloc): Likewise. + (emit_debug_insn_after_noloc): Likewise. + (emit_barrier_after): Strengthen return type from rtx to + rtx_barrier *. + (emit_label_after): Strengthen return type from rtx to rtx_insn *. + Add checked cast for now when converting "label" from rtx to + rtx_insn *. + (emit_pattern_after_setloc): Strengthen return type from rtx to + rtx_insn *. Add checked casts for now when converting "last" from + rtx to rtx_insn *. + (emit_pattern_after): Strengthen return type from rtx to + rtx_insn *. + (emit_insn_after_setloc): Likewise. + (emit_insn_after): Likewise. + (emit_jump_insn_after_setloc): Likewise. + (emit_jump_insn_after): Likewise. + (emit_call_insn_after_setloc): Likewise. + (emit_call_insn_after): Likewise. + (emit_debug_insn_after_setloc): Likewise. + (emit_debug_insn_after): Likewise. + (emit_pattern_before_setloc): Likewise. Add checked casts for now + when converting "last" from rtx to rtx_insn *. + (emit_pattern_before): Strengthen return type from rtx to + rtx_insn *. + (emit_insn_before_setloc): Likewise. + (emit_insn_before): Likewise. + (emit_jump_insn_before_setloc): Likewise. + (emit_jump_insn_before): Likewise. + (emit_call_insn_before_setloc): Likewise. + (emit_call_insn_before): Likewise. + (emit_debug_insn_before_setloc): Likewise. + (emit_debug_insn_before): Likewise. + (emit_insn): Strengthen return type and locals "last", "insn", + "next" from rtx to rtx_insn *. Add checked cast to rtx_insn + within cases where we know we have an insn. + (emit_debug_insn): Likewise. + (emit_jump_insn): Likewise. + (emit_call_insn): Strengthen return type and local "insn" from rtx + to rtx_insn *. + (emit_label): Strengthen return type from rtx to rtx_insn *. Add + a checked cast to rtx_insn * for now on "label". + (emit_barrier): Strengthen return type from rtx to rtx_barrier *. + (emit_clobber): Strengthen return type from rtx to rtx_insn *. + (emit_use): Likewise. + (gen_use): Likewise, also for local "seq". + (emit): Likewise for return type and local "insn". + (rtx_insn): Likewise for return type and local "new_rtx". + + * cfgrtl.c (emit_barrier_after_bb): Strengthen local "barrier" + from rtx to rtx_barrier *. + + * config/sh/sh.c (output_stack_adjust): Since emit_insn has + changed return type from rtx to rtx_insn *, we must update + "emit_fn" type, and this in turn means updating... + (frame_insn): ...this. Strengthen return type from rtx to + rtx_insn *. Introduce a new local "insn" of the appropriate type. + +2014-08-19 David Malcolm + * emit-rtl.c (emit_jump_table_data): Strengthen return type from rtx to rtx_jump_table_data *. Also for local. * rtl.h (emit_jump_table_data): Likewise. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index f0e7f5c..902de13 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1446,7 +1446,7 @@ rtl_redirect_edge_and_branch (edge e, basic_block target) void emit_barrier_after_bb (basic_block bb) { - rtx barrier = emit_barrier_after (BB_END (bb)); + rtx_barrier *barrier = emit_barrier_after (BB_END (bb)); gcc_assert (current_ir_type () == IR_RTL_CFGRTL || current_ir_type () == IR_RTL_CFGLAYOUT); if (current_ir_type () == IR_RTL_CFGLAYOUT) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 673fc7e..d927f66 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -195,7 +195,7 @@ static rtx gen_block_redirect (rtx, int, int); static void sh_reorg (void); static void sh_option_override (void); static void output_stack_adjust (int, rtx, int, HARD_REG_SET *, bool); -static rtx frame_insn (rtx); +static rtx_insn *frame_insn (rtx); static rtx push (int); static void pop (int); static void push_regs (HARD_REG_SET *, int); @@ -6784,7 +6784,7 @@ static void output_stack_adjust (int size, rtx reg, int epilogue_p, HARD_REG_SET *live_regs_mask, bool frame_p) { - rtx (*emit_fn) (rtx) = frame_p ? &frame_insn : &emit_insn; + rtx_insn *(*emit_fn) (rtx) = frame_p ? &frame_insn : &emit_insn; if (size) { HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT; @@ -6944,12 +6944,12 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, /* Emit the specified insn and mark it as frame related. FIXME: Rename this to emit_frame_insn. */ -static rtx +static rtx_insn * frame_insn (rtx x) { - x = emit_insn (x); - RTX_FRAME_RELATED_P (x) = 1; - return x; + rtx_insn *insn = emit_insn (x); + RTX_FRAME_RELATED_P (insn) = 1; + return insn; } /* Output RTL to push register RN onto the stack. */ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 75fb439..ccfa22a 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -4269,7 +4269,7 @@ reorder_insns (rtx from, rtx to, rtx after) SEQUENCE rtl results in much fragmented RTL memory since the SEQUENCE generated would almost certainly die right after it was created. */ -static rtx +static rtx_insn * emit_pattern_before_noloc (rtx x, rtx before, rtx last, basic_block bb, rtx_insn *(*make_raw) (rtx)) { @@ -4278,7 +4278,7 @@ emit_pattern_before_noloc (rtx x, rtx before, rtx last, basic_block bb, gcc_assert (before); if (x == NULL_RTX) - return last; + return safe_as_a (last); switch (GET_CODE (x)) { @@ -4311,12 +4311,12 @@ emit_pattern_before_noloc (rtx x, rtx before, rtx last, basic_block bb, break; } - return last; + return safe_as_a (last); } /* Make X be output before the instruction BEFORE. */ -rtx +rtx_insn * emit_insn_before_noloc (rtx x, rtx before, basic_block bb) { return emit_pattern_before_noloc (x, before, before, bb, make_insn_raw); @@ -4325,7 +4325,7 @@ emit_insn_before_noloc (rtx x, rtx before, basic_block bb) /* Make an instruction with body X and code JUMP_INSN and output it before the instruction BEFORE. */ -rtx +rtx_insn * emit_jump_insn_before_noloc (rtx x, rtx before) { return emit_pattern_before_noloc (x, before, NULL_RTX, NULL, @@ -4335,7 +4335,7 @@ emit_jump_insn_before_noloc (rtx x, rtx before) /* Make an instruction with body X and code CALL_INSN and output it before the instruction BEFORE. */ -rtx +rtx_insn * emit_call_insn_before_noloc (rtx x, rtx before) { return emit_pattern_before_noloc (x, before, NULL_RTX, NULL, @@ -4345,7 +4345,7 @@ emit_call_insn_before_noloc (rtx x, rtx before) /* Make an instruction with body X and code DEBUG_INSN and output it before the instruction BEFORE. */ -rtx +rtx_insn * emit_debug_insn_before_noloc (rtx x, rtx before) { return emit_pattern_before_noloc (x, before, NULL_RTX, NULL, @@ -4355,10 +4355,10 @@ emit_debug_insn_before_noloc (rtx x, rtx before) /* Make an insn of code BARRIER and output it before the insn BEFORE. */ -rtx +rtx_barrier * emit_barrier_before (rtx before) { - rtx insn = rtx_alloc (BARRIER); + rtx_barrier *insn = as_a (rtx_alloc (BARRIER)); INSN_UID (insn) = cur_insn_uid++; @@ -4368,13 +4368,13 @@ emit_barrier_before (rtx before) /* Emit the label LABEL before the insn BEFORE. */ -rtx +rtx_insn * emit_label_before (rtx label, rtx before) { gcc_checking_assert (INSN_UID (label) == 0); INSN_UID (label) = cur_insn_uid++; add_insn_before (label, before, NULL); - return label; + return as_a (label); } /* Helper for emit_insn_after, handles lists of instructions @@ -4423,7 +4423,7 @@ emit_insn_after_1 (rtx first, rtx after, basic_block bb) return last; } -static rtx +static rtx_insn * emit_pattern_after_noloc (rtx x, rtx after, basic_block bb, rtx_insn *(*make_raw)(rtx)) { @@ -4432,7 +4432,7 @@ emit_pattern_after_noloc (rtx x, rtx after, basic_block bb, gcc_assert (after); if (x == NULL_RTX) - return last; + return safe_as_a (last); switch (GET_CODE (x)) { @@ -4458,13 +4458,13 @@ emit_pattern_after_noloc (rtx x, rtx after, basic_block bb, break; } - return last; + return safe_as_a (last); } /* Make X be output after the insn AFTER and set the BB of insn. If BB is NULL, an attempt is made to infer the BB from AFTER. */ -rtx +rtx_insn * emit_insn_after_noloc (rtx x, rtx after, basic_block bb) { return emit_pattern_after_noloc (x, after, bb, make_insn_raw); @@ -4474,7 +4474,7 @@ emit_insn_after_noloc (rtx x, rtx after, basic_block bb) /* Make an insn of code JUMP_INSN with body X and output it after the insn AFTER. */ -rtx +rtx_insn * emit_jump_insn_after_noloc (rtx x, rtx after) { return emit_pattern_after_noloc (x, after, NULL, make_jump_insn_raw); @@ -4483,7 +4483,7 @@ emit_jump_insn_after_noloc (rtx x, rtx after) /* Make an instruction with body X and code CALL_INSN and output it after the instruction AFTER. */ -rtx +rtx_insn * emit_call_insn_after_noloc (rtx x, rtx after) { return emit_pattern_after_noloc (x, after, NULL, make_call_insn_raw); @@ -4492,7 +4492,7 @@ emit_call_insn_after_noloc (rtx x, rtx after) /* Make an instruction with body X and code CALL_INSN and output it after the instruction AFTER. */ -rtx +rtx_insn * emit_debug_insn_after_noloc (rtx x, rtx after) { return emit_pattern_after_noloc (x, after, NULL, make_debug_insn_raw); @@ -4501,10 +4501,10 @@ emit_debug_insn_after_noloc (rtx x, rtx after) /* Make an insn of code BARRIER and output it after the insn AFTER. */ -rtx +rtx_barrier * emit_barrier_after (rtx after) { - rtx insn = rtx_alloc (BARRIER); + rtx_barrier *insn = as_a (rtx_alloc (BARRIER)); INSN_UID (insn) = cur_insn_uid++; @@ -4514,13 +4514,13 @@ emit_barrier_after (rtx after) /* Emit the label LABEL after the insn AFTER. */ -rtx +rtx_insn * emit_label_after (rtx label, rtx after) { gcc_checking_assert (INSN_UID (label) == 0); INSN_UID (label) = cur_insn_uid++; add_insn_after (label, after, NULL); - return label; + return as_a (label); } /* Notes require a bit of special handling: Some notes need to have their @@ -4590,14 +4590,14 @@ emit_note_before (enum insn_note subtype, rtx before) /* Insert PATTERN after AFTER, setting its INSN_LOCATION to LOC. MAKE_RAW indicates how to turn PATTERN into a real insn. */ -static rtx +static rtx_insn * emit_pattern_after_setloc (rtx pattern, rtx after, int loc, rtx_insn *(*make_raw) (rtx)) { rtx last = emit_pattern_after_noloc (pattern, after, NULL, make_raw); if (pattern == NULL_RTX || !loc) - return last; + return safe_as_a (last); after = NEXT_INSN (after); while (1) @@ -4608,14 +4608,14 @@ emit_pattern_after_setloc (rtx pattern, rtx after, int loc, break; after = NEXT_INSN (after); } - return last; + return safe_as_a (last); } /* Insert PATTERN after AFTER. MAKE_RAW indicates how to turn PATTERN into a real insn. SKIP_DEBUG_INSNS indicates whether to insert after any DEBUG_INSNs. */ -static rtx +static rtx_insn * emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns, rtx_insn *(*make_raw) (rtx)) { @@ -4633,56 +4633,56 @@ emit_pattern_after (rtx pattern, rtx after, bool skip_debug_insns, } /* Like emit_insn_after_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_insn_after_setloc (rtx pattern, rtx after, int loc) { return emit_pattern_after_setloc (pattern, after, loc, make_insn_raw); } /* Like emit_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ -rtx +rtx_insn * emit_insn_after (rtx pattern, rtx after) { return emit_pattern_after (pattern, after, true, make_insn_raw); } /* Like emit_jump_insn_after_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_jump_insn_after_setloc (rtx pattern, rtx after, int loc) { return emit_pattern_after_setloc (pattern, after, loc, make_jump_insn_raw); } /* Like emit_jump_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ -rtx +rtx_insn * emit_jump_insn_after (rtx pattern, rtx after) { return emit_pattern_after (pattern, after, true, make_jump_insn_raw); } /* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_call_insn_after_setloc (rtx pattern, rtx after, int loc) { return emit_pattern_after_setloc (pattern, after, loc, make_call_insn_raw); } /* Like emit_call_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ -rtx +rtx_insn * emit_call_insn_after (rtx pattern, rtx after) { return emit_pattern_after (pattern, after, true, make_call_insn_raw); } /* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_debug_insn_after_setloc (rtx pattern, rtx after, int loc) { return emit_pattern_after_setloc (pattern, after, loc, make_debug_insn_raw); } /* Like emit_debug_insn_after_noloc, but set INSN_LOCATION according to AFTER. */ -rtx +rtx_insn * emit_debug_insn_after (rtx pattern, rtx after) { return emit_pattern_after (pattern, after, false, make_debug_insn_raw); @@ -4693,7 +4693,7 @@ emit_debug_insn_after (rtx pattern, rtx after) indicates if PATTERN is meant for an INSN as opposed to a JUMP_INSN, CALL_INSN, etc. */ -static rtx +static rtx_insn * emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp, rtx_insn *(*make_raw) (rtx)) { @@ -4703,7 +4703,7 @@ emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp, NULL, make_raw); if (pattern == NULL_RTX || !loc) - return last; + return safe_as_a (last); if (!first) first = get_insns (); @@ -4717,7 +4717,7 @@ emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp, break; first = NEXT_INSN (first); } - return last; + return safe_as_a (last); } /* Insert PATTERN before BEFORE. MAKE_RAW indicates how to turn PATTERN @@ -4725,7 +4725,7 @@ emit_pattern_before_setloc (rtx pattern, rtx before, int loc, bool insnp, before any DEBUG_INSNs. INSNP indicates if PATTERN is meant for an INSN as opposed to a JUMP_INSN, CALL_INSN, etc. */ -static rtx +static rtx_insn * emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns, bool insnp, rtx_insn *(*make_raw) (rtx)) { @@ -4745,7 +4745,7 @@ emit_pattern_before (rtx pattern, rtx before, bool skip_debug_insns, } /* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_insn_before_setloc (rtx pattern, rtx before, int loc) { return emit_pattern_before_setloc (pattern, before, loc, true, @@ -4753,14 +4753,14 @@ emit_insn_before_setloc (rtx pattern, rtx before, int loc) } /* Like emit_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */ -rtx +rtx_insn * emit_insn_before (rtx pattern, rtx before) { return emit_pattern_before (pattern, before, true, true, make_insn_raw); } /* like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc) { return emit_pattern_before_setloc (pattern, before, loc, false, @@ -4768,7 +4768,7 @@ emit_jump_insn_before_setloc (rtx pattern, rtx before, int loc) } /* Like emit_jump_insn_before_noloc, but set INSN_LOCATION according to BEFORE. */ -rtx +rtx_insn * emit_jump_insn_before (rtx pattern, rtx before) { return emit_pattern_before (pattern, before, true, false, @@ -4776,7 +4776,7 @@ emit_jump_insn_before (rtx pattern, rtx before) } /* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_call_insn_before_setloc (rtx pattern, rtx before, int loc) { return emit_pattern_before_setloc (pattern, before, loc, false, @@ -4785,7 +4785,7 @@ emit_call_insn_before_setloc (rtx pattern, rtx before, int loc) /* Like emit_call_insn_before_noloc, but set insn_location according to BEFORE. */ -rtx +rtx_insn * emit_call_insn_before (rtx pattern, rtx before) { return emit_pattern_before (pattern, before, true, false, @@ -4793,7 +4793,7 @@ emit_call_insn_before (rtx pattern, rtx before) } /* Like emit_insn_before_noloc, but set INSN_LOCATION according to LOC. */ -rtx +rtx_insn * emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc) { return emit_pattern_before_setloc (pattern, before, loc, false, @@ -4802,7 +4802,7 @@ emit_debug_insn_before_setloc (rtx pattern, rtx before, int loc) /* Like emit_debug_insn_before_noloc, but set insn_location according to BEFORE. */ -rtx +rtx_insn * emit_debug_insn_before (rtx pattern, rtx before) { return emit_pattern_before (pattern, before, false, false, @@ -4814,11 +4814,11 @@ emit_debug_insn_before (rtx pattern, rtx before) Returns the last insn emitted. */ -rtx +rtx_insn * emit_insn (rtx x) { - rtx last = get_last_insn (); - rtx insn; + rtx_insn *last = get_last_insn (); + rtx_insn *insn; if (x == NULL_RTX) return last; @@ -4832,10 +4832,10 @@ emit_insn (rtx x) case CODE_LABEL: case BARRIER: case NOTE: - insn = x; + insn = as_a (x); while (insn) { - rtx next = NEXT_INSN (insn); + rtx_insn *next = NEXT_INSN (insn); add_insn (insn); last = insn; insn = next; @@ -4861,11 +4861,11 @@ emit_insn (rtx x) /* Make an insn of code DEBUG_INSN with pattern X and add it to the end of the doubly-linked list. */ -rtx +rtx_insn * emit_debug_insn (rtx x) { - rtx last = get_last_insn (); - rtx insn; + rtx_insn *last = get_last_insn (); + rtx_insn *insn; if (x == NULL_RTX) return last; @@ -4879,10 +4879,10 @@ emit_debug_insn (rtx x) case CODE_LABEL: case BARRIER: case NOTE: - insn = x; + insn = as_a (x); while (insn) { - rtx next = NEXT_INSN (insn); + rtx_insn *next = NEXT_INSN (insn); add_insn (insn); last = insn; insn = next; @@ -4908,10 +4908,11 @@ emit_debug_insn (rtx x) /* Make an insn of code JUMP_INSN with pattern X and add it to the end of the doubly-linked list. */ -rtx +rtx_insn * emit_jump_insn (rtx x) { - rtx last = NULL_RTX, insn; + rtx_insn *last = NULL; + rtx_insn *insn; switch (GET_CODE (x)) { @@ -4922,10 +4923,10 @@ emit_jump_insn (rtx x) case CODE_LABEL: case BARRIER: case NOTE: - insn = x; + insn = as_a (x); while (insn) { - rtx next = NEXT_INSN (insn); + rtx_insn *next = NEXT_INSN (insn); add_insn (insn); last = insn; insn = next; @@ -4951,10 +4952,10 @@ emit_jump_insn (rtx x) /* Make an insn of code CALL_INSN with pattern X and add it to the end of the doubly-linked list. */ -rtx +rtx_insn * emit_call_insn (rtx x) { - rtx insn; + rtx_insn *insn; switch (GET_CODE (x)) { @@ -4986,13 +4987,13 @@ emit_call_insn (rtx x) /* Add the label LABEL to the end of the doubly-linked list. */ -rtx +rtx_insn * emit_label (rtx label) { gcc_checking_assert (INSN_UID (label) == 0); INSN_UID (label) = cur_insn_uid++; add_insn (label); - return label; + return as_a (label); } /* Make an insn of code JUMP_TABLE_DATA @@ -5013,10 +5014,10 @@ emit_jump_table_data (rtx table) /* Make an insn of code BARRIER and add it to the end of the doubly-linked list. */ -rtx +rtx_barrier * emit_barrier (void) { - rtx barrier = rtx_alloc (BARRIER); + rtx_barrier *barrier = as_a (rtx_alloc (BARRIER)); INSN_UID (barrier) = cur_insn_uid++; add_insn (barrier); return barrier; @@ -5047,7 +5048,7 @@ emit_note (enum insn_note kind) /* Emit a clobber of lvalue X. */ -rtx +rtx_insn * emit_clobber (rtx x) { /* CONCATs should not appear in the insn stream. */ @@ -5061,10 +5062,10 @@ emit_clobber (rtx x) /* Return a sequence of insns to clobber lvalue X. */ -rtx +rtx_insn * gen_clobber (rtx x) { - rtx seq; + rtx_insn *seq; start_sequence (); emit_clobber (x); @@ -5075,7 +5076,7 @@ gen_clobber (rtx x) /* Emit a use of rvalue X. */ -rtx +rtx_insn * emit_use (rtx x) { /* CONCATs should not appear in the insn stream. */ @@ -5089,10 +5090,10 @@ emit_use (rtx x) /* Return a sequence of insns to use rvalue X. */ -rtx +rtx_insn * gen_use (rtx x) { - rtx seq; + rtx_insn *seq; start_sequence (); emit_use (x); @@ -5237,7 +5238,7 @@ classify_insn (rtx x) /* Emit the rtl pattern X as an appropriate kind of insn. If X is a label, it is simply added into the insn chain. */ -rtx +rtx_insn * emit (rtx x) { enum rtx_code code = classify_insn (x); @@ -5250,7 +5251,7 @@ emit (rtx x) return emit_insn (x); case JUMP_INSN: { - rtx insn = emit_jump_insn (x); + rtx_insn *insn = emit_jump_insn (x); if (any_uncondjump_p (insn) || GET_CODE (x) == RETURN) return emit_barrier (); return insn; @@ -6055,10 +6056,11 @@ init_emit_once (void) /* Produce exact duplicate of insn INSN after AFTER. Care updating of libcall regions if present. */ -rtx +rtx_insn * emit_copy_of_insn_after (rtx insn, rtx after) { - rtx new_rtx, link; + rtx_insn *new_rtx; + rtx link; switch (GET_CODE (insn)) { diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index e97e0cb..e0deaff 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -66,7 +66,7 @@ extern rtx copy_insn_1 (rtx); extern rtx copy_insn (rtx); extern rtx copy_delay_slot_insn (rtx); extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode); -extern rtx emit_copy_of_insn_after (rtx, rtx); +extern rtx_insn *emit_copy_of_insn_after (rtx, rtx); extern void set_reg_attrs_from_value (rtx, rtx); extern void set_reg_attrs_for_parm (rtx, rtx); extern void set_reg_attrs_for_decl_rtl (tree t, rtx x); diff --git a/gcc/rtl.h b/gcc/rtl.h index 13494fd..64b9732 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2379,49 +2379,49 @@ extern rtx assign_stack_temp_for_type (enum machine_mode, HOST_WIDE_INT, tree); extern rtx assign_temp (tree, int, int); /* In emit-rtl.c */ -extern rtx emit_insn_before (rtx, rtx); -extern rtx emit_insn_before_noloc (rtx, rtx, basic_block); -extern rtx emit_insn_before_setloc (rtx, rtx, int); -extern rtx emit_jump_insn_before (rtx, rtx); -extern rtx emit_jump_insn_before_noloc (rtx, rtx); -extern rtx emit_jump_insn_before_setloc (rtx, rtx, int); -extern rtx emit_call_insn_before (rtx, rtx); -extern rtx emit_call_insn_before_noloc (rtx, rtx); -extern rtx emit_call_insn_before_setloc (rtx, rtx, int); -extern rtx emit_debug_insn_before (rtx, rtx); -extern rtx emit_debug_insn_before_noloc (rtx, rtx); -extern rtx emit_debug_insn_before_setloc (rtx, rtx, int); -extern rtx emit_barrier_before (rtx); -extern rtx emit_label_before (rtx, rtx); +extern rtx_insn *emit_insn_before (rtx, rtx); +extern rtx_insn *emit_insn_before_noloc (rtx, rtx, basic_block); +extern rtx_insn *emit_insn_before_setloc (rtx, rtx, int); +extern rtx_insn *emit_jump_insn_before (rtx, rtx); +extern rtx_insn *emit_jump_insn_before_noloc (rtx, rtx); +extern rtx_insn *emit_jump_insn_before_setloc (rtx, rtx, int); +extern rtx_insn *emit_call_insn_before (rtx, rtx); +extern rtx_insn *emit_call_insn_before_noloc (rtx, rtx); +extern rtx_insn *emit_call_insn_before_setloc (rtx, rtx, int); +extern rtx_insn *emit_debug_insn_before (rtx, rtx); +extern rtx_insn *emit_debug_insn_before_noloc (rtx, rtx); +extern rtx_insn *emit_debug_insn_before_setloc (rtx, rtx, int); +extern rtx_barrier *emit_barrier_before (rtx); +extern rtx_insn *emit_label_before (rtx, rtx); extern rtx_note *emit_note_before (enum insn_note, rtx); -extern rtx emit_insn_after (rtx, rtx); -extern rtx emit_insn_after_noloc (rtx, rtx, basic_block); -extern rtx emit_insn_after_setloc (rtx, rtx, int); -extern rtx emit_jump_insn_after (rtx, rtx); -extern rtx emit_jump_insn_after_noloc (rtx, rtx); -extern rtx emit_jump_insn_after_setloc (rtx, rtx, int); -extern rtx emit_call_insn_after (rtx, rtx); -extern rtx emit_call_insn_after_noloc (rtx, rtx); -extern rtx emit_call_insn_after_setloc (rtx, rtx, int); -extern rtx emit_debug_insn_after (rtx, rtx); -extern rtx emit_debug_insn_after_noloc (rtx, rtx); -extern rtx emit_debug_insn_after_setloc (rtx, rtx, int); -extern rtx emit_barrier_after (rtx); -extern rtx emit_label_after (rtx, rtx); +extern rtx_insn *emit_insn_after (rtx, rtx); +extern rtx_insn *emit_insn_after_noloc (rtx, rtx, basic_block); +extern rtx_insn *emit_insn_after_setloc (rtx, rtx, int); +extern rtx_insn *emit_jump_insn_after (rtx, rtx); +extern rtx_insn *emit_jump_insn_after_noloc (rtx, rtx); +extern rtx_insn *emit_jump_insn_after_setloc (rtx, rtx, int); +extern rtx_insn *emit_call_insn_after (rtx, rtx); +extern rtx_insn *emit_call_insn_after_noloc (rtx, rtx); +extern rtx_insn *emit_call_insn_after_setloc (rtx, rtx, int); +extern rtx_insn *emit_debug_insn_after (rtx, rtx); +extern rtx_insn *emit_debug_insn_after_noloc (rtx, rtx); +extern rtx_insn *emit_debug_insn_after_setloc (rtx, rtx, int); +extern rtx_barrier *emit_barrier_after (rtx); +extern rtx_insn *emit_label_after (rtx, rtx); extern rtx_note *emit_note_after (enum insn_note, rtx); -extern rtx emit_insn (rtx); -extern rtx emit_debug_insn (rtx); -extern rtx emit_jump_insn (rtx); -extern rtx emit_call_insn (rtx); -extern rtx emit_label (rtx); +extern rtx_insn *emit_insn (rtx); +extern rtx_insn *emit_debug_insn (rtx); +extern rtx_insn *emit_jump_insn (rtx); +extern rtx_insn *emit_call_insn (rtx); +extern rtx_insn *emit_label (rtx); extern rtx_jump_table_data *emit_jump_table_data (rtx); -extern rtx emit_barrier (void); +extern rtx_barrier *emit_barrier (void); extern rtx_note *emit_note (enum insn_note); extern rtx_note *emit_note_copy (rtx_note *); -extern rtx gen_clobber (rtx); -extern rtx emit_clobber (rtx); -extern rtx gen_use (rtx); -extern rtx emit_use (rtx); +extern rtx_insn *gen_clobber (rtx); +extern rtx_insn *emit_clobber (rtx); +extern rtx_insn *gen_use (rtx); +extern rtx_insn *emit_use (rtx); extern rtx_insn *make_insn_raw (rtx); extern void add_function_usage_to (rtx, rtx); extern rtx_call_insn *last_call_insn (void); @@ -3094,7 +3094,7 @@ extern void add_insn (rtx); extern void add_insn_before (rtx, rtx, basic_block); extern void add_insn_after (rtx, rtx, basic_block); extern void remove_insn (rtx); -extern rtx emit (rtx); +extern rtx_insn *emit (rtx); extern void delete_insn (rtx); extern rtx_insn *entry_of_function (void); extern void emit_insn_at_entry (rtx); -- 2.7.4