* fwprop.c: Make emit-rtl.h include last.
* rtlanal.c: Include emit-rtl.h.
* genautomata.c: Output emit-rtl include into insn-automata.c
* df-scan.c: Include emit-rtl.h.
* haifa-sched.c: Indlude emit-rtl.h.
* mode-switching.c: Indlude emit-rtl.h.
* graph.c: Indlude emit-rtl.h.
* sel-sched.c: Include emit-rtl.h.
* sel-sched-ir.c: Include emit-rtl.h.
* ira-build.c: Include emit-rtl.h.
* emit-rtl.c: (first_insn, last_insn): Remove defines.
(get_insns, set_first_insn, get_last_insn, set_last_insn, get_max_uid):
Move to emit-rtl.h.
(set_new_first_and_last_insn, get_last_insn_anywhere, get_first_nonnote_insn,
get_last_nonnote_insn, try_split, make_call_insn_raw, add_insn_after,
add_insn_before, remove_insn, delete_insns_since, reorder_insns_nobb,
emit_insn_after_1, emit_debug_insn_before, emit_insn, start_sequence,
push_to_sequence, push_to_sequence2, push_topmost_sequence, end_sequence,
copy_insn): Use accessor functions.
* emit-rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
mem_expr_equal_p): Move here from rtl.h
(get_insns, set_first-insn, get_last_insn, set_last_insn, get_max_uid):
Move here from emit-rtl.c; make inline.
* cfglayout.h: Include emit-rtl.h
* rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
mem_expr_equal_p, get_insns, set_first-insn, get_last_insn, set_last_insn,
get_max_uid): Move to emit-rtl.h.
* reg-stack.c: Include emit-rtl.h
* dce.c: Likewise.
From-SVN: r160111
+2010-06-01 Jan Hubicka <jh@suse.cz>
+
+ * fwprop.c: Make emit-rtl.h include last.
+ * rtlanal.c: Include emit-rtl.h.
+ * genautomata.c: Output emit-rtl include into insn-automata.c
+ * df-scan.c: Include emit-rtl.h.
+ * haifa-sched.c: Indlude emit-rtl.h.
+ * mode-switching.c: Indlude emit-rtl.h.
+ * graph.c: Indlude emit-rtl.h.
+ * sel-sched.c: Include emit-rtl.h.
+ * sel-sched-ir.c: Include emit-rtl.h.
+ * ira-build.c: Include emit-rtl.h.
+ * emit-rtl.c: (first_insn, last_insn): Remove defines.
+ (get_insns, set_first_insn, get_last_insn, set_last_insn, get_max_uid):
+ Move to emit-rtl.h.
+ (set_new_first_and_last_insn, get_last_insn_anywhere, get_first_nonnote_insn,
+ get_last_nonnote_insn, try_split, make_call_insn_raw, add_insn_after,
+ add_insn_before, remove_insn, delete_insns_since, reorder_insns_nobb,
+ emit_insn_after_1, emit_debug_insn_before, emit_insn, start_sequence,
+ push_to_sequence, push_to_sequence2, push_topmost_sequence, end_sequence,
+ copy_insn): Use accessor functions.
+ * emit-rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
+ gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
+ set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
+ mem_expr_equal_p): Move here from rtl.h
+ (get_insns, set_first-insn, get_last_insn, set_last_insn, get_max_uid):
+ Move here from emit-rtl.c; make inline.
+ * cfglayout.h: Include emit-rtl.h
+ * rtl.h (gen_blockage, gen_rtvec, copy_insn_1, copy_insn,
+ gen_int_mode, emit_copy_of_insn_after, set_reg_attrs_from_value,
+ set_reg_attrs_for_parm, set_reg_attrs_for_decl_rtl, adjust_reg_mode,
+ mem_expr_equal_p, get_insns, set_first-insn, get_last_insn, set_last_insn,
+ get_max_uid): Move to emit-rtl.h.
+ * reg-stack.c: Include emit-rtl.h
+ * dce.c: Likewise.
+
2010-06-01 Jan Hubicka <jh@suse.cz>
* cgraph.h (tree_function_versioning): Update prototype.
opts.h $(PLUGINS_H)
graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) $(FLAGS_H) output.h \
$(RTL_H) $(FUNCTION_H) hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) \
- $(CONFIG_H)
+ $(CONFIG_H) $(EMIT_RTL_H)
sbitmap.o: sbitmap.c sbitmap.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(BASIC_BLOCK_H)
ebitmap.o: ebitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(EBITMAP_H) $(RTL_H) $(FLAGS_H) $(OBSTACK_H)
rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
$(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) \
$(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \
- $(DF_H)
+ $(DF_H) $(EMIT_RTL_H)
varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) hard-reg-set.h $(REGS_H) \
$(DF_H) $(DBGCNT_H)
dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(EXCEPT_H) $(DF_H) cselib.h \
- $(DBGCNT_H) dce.h $(TIMEVAR_H) $(TREE_PASS_H) $(DBGCNT_H) $(TM_P_H)
+ $(DBGCNT_H) dce.h $(TIMEVAR_H) $(TREE_PASS_H) $(DBGCNT_H) $(TM_P_H) \
+ $(EMIT_RTL_H)
dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) $(TIMEVAR_H) \
mode-switching.o : mode-switching.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(INSN_ATTR_H) $(RECOG_H) $(BASIC_BLOCK_H) $(TM_P_H) $(FUNCTION_H) \
- output.h $(TREE_PASS_H) $(TIMEVAR_H) $(DF_H) $(TARGET_H)
+ output.h $(TREE_PASS_H) $(TIMEVAR_H) $(DF_H) $(TARGET_H) $(EMIT_RTL_H)
tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) $(TREE_PASS_H) $(FLAGS_H) $(BASIC_BLOCK_H) \
insn-config.h $(RECOG_H) $(FUNCTION_H) $(REGS_H) alloc-pool.h \
hard-reg-set.h $(BASIC_BLOCK_H) $(DF_H) $(BITMAP_H) sbitmap.h $(TIMEVAR_H) \
$(TM_P_H) $(FLAGS_H) $(TARGET_H) $(TARGET_DEF_H) $(TREE_H) output.h \
- $(TREE_PASS_H)
+ $(TREE_PASS_H) $(EMIT_RTL_H)
df-byte-scan.o : df-byte-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TM_P_H) $(DF_H) output.h $(DBGCNT_H)
regstat.o : regstat.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h $(FUNCTION_H) \
$(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(TM_P_H) $(TARGET_H) output.h \
- $(PARAMS_H) $(DBGCNT_H) $(CFGLOOP_H) ira.h
+ $(PARAMS_H) $(DBGCNT_H) $(CFGLOOP_H) ira.h $(EMIT_RTL_H)
sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) cselib.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(TM_P_H) output.h $(TARGET_H) $(TIMEVAR_H) $(TREE_PASS_H) \
$(SCHED_INT_H) $(GGC_H) $(TREE_H) langhooks.h rtlhooks-def.h \
- $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) sel-sched.h $(DBGCNT_H)
+ $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) sel-sched.h $(DBGCNT_H) $(EMIT_RTL_H)
sel-sched-dump.o : sel-sched-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(FUNCTION_H) $(INSN_ATTR_H) $(TOPLEV_H) $(RECOG_H) $(EXCEPT_H) $(PARAMS_H) \
$(TM_P_H) $(TARGET_H) $(TIMEVAR_H) $(TREE_PASS_H) $(SCHED_INT_H) $(GGC_H) \
- $(TREE_H) langhooks.h rtlhooks-def.h $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H)
+ $(TREE_H) langhooks.h rtlhooks-def.h $(SEL_SCHED_IR_H) $(SEL_SCHED_DUMP_H) \
+ $(EMIT_RTL_H)
final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \
insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \
$(RTL_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
insn-config.h $(TOPLEV_H) reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \
$(BASIC_BLOCK_H) $(CFGLAYOUT_H) output.h $(TIMEVAR_H) \
- $(TREE_PASS_H) $(TARGET_H) vecprim.h $(DF_H)
+ $(TREE_PASS_H) $(TARGET_H) vecprim.h $(DF_H) $(EMIT_RTL_H)
sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \
$(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \
$(FUNCTION_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \
$(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) $(TREE_PASS_H) vecprim.h \
- $(DF_H)
+ $(DF_H) $(EMIT_RTL_H)
timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TIMEVAR_H) $(FLAGS_H) intl.h $(TOPLEV_H) $(RTL_H) timevar.def
regcprop.o : regcprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) output.h $(INSN_ATTR_H) \
- insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H)
+ insn-config.h $(TOPLEV_H) $(RECOG_H) $(TM_P_H) $(FLAGS_H) $(EMIT_RTL_H)
insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TM_P_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) \
dfp.h $(FLAGS_H) output.h insn-config.h hard-reg-set.h $(RECOG_H) \
#include "tree-pass.h"
#include "df.h"
#include "vecprim.h"
+#include "emit-rtl.h"
/* Holds the interesting trailing notes for the function. */
rtx cfg_layout_function_footer;
#include "tree-pass.h"
#include "dbgcnt.h"
#include "tm_p.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
/* -------------------------------------------------------------------------
#include "target-def.h"
#include "df.h"
#include "tree-pass.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
DEF_VEC_P(df_ref);
DEF_VEC_ALLOC_P_STACK(df_ref);
static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
htab_t const_fixed_htab;
-#define first_insn (crtl->emit.x_first_insn)
-#define last_insn (crtl->emit.x_last_insn)
#define cur_insn_uid (crtl->emit.x_cur_insn_uid)
#define cur_debug_insn_uid (crtl->emit.x_cur_debug_insn_uid)
#define last_location (crtl->emit.x_last_location)
{
rtx insn;
- first_insn = first;
- last_insn = last;
+ set_first_insn (first);
+ set_last_insn (last);
cur_insn_uid = 0;
if (MIN_NONDEBUG_INSN_UID || MAY_HAVE_DEBUG_INSNS)
\f
/* Emission of insns (adding them to the doubly-linked list). */
-/* Return the first insn of the current sequence or current function. */
-
-rtx
-get_insns (void)
-{
- return first_insn;
-}
-
-/* Specify a new insn as the first in the chain. */
-
-void
-set_first_insn (rtx insn)
-{
- gcc_assert (!PREV_INSN (insn));
- first_insn = insn;
-}
-
-/* Return the last insn emitted in current sequence or current function. */
-
-rtx
-get_last_insn (void)
-{
- return last_insn;
-}
-
-/* Specify a new insn as the last in the chain. */
-
-void
-set_last_insn (rtx insn)
-{
- gcc_assert (!NEXT_INSN (insn));
- last_insn = insn;
-}
-
/* Return the last insn emitted, even if it is in a sequence now pushed. */
rtx
get_last_insn_anywhere (void)
{
struct sequence_stack *stack;
- if (last_insn)
- return last_insn;
+ if (get_last_insn ())
+ return get_last_insn ();
for (stack = seq_stack; stack; stack = stack->next)
if (stack->last != 0)
return stack->last;
rtx
get_first_nonnote_insn (void)
{
- rtx insn = first_insn;
+ rtx insn = get_insns ();
if (insn)
{
rtx
get_last_nonnote_insn (void)
{
- rtx insn = last_insn;
+ rtx insn = get_last_insn ();
if (insn)
{
return insn;
}
-/* Return a number larger than any instruction's uid in this function. */
-
-int
-get_max_uid (void)
-{
- return cur_insn_uid;
-}
-
/* Return the number of actual (non-debug) insns emitted in this
function. */
/* Return either the first or the last insn, depending on which was
requested. */
return last
- ? (after ? PREV_INSN (after) : last_insn)
+ ? (after ? PREV_INSN (after) : get_last_insn ())
: NEXT_INSN (before);
}
\f
void
add_insn (rtx insn)
{
- PREV_INSN (insn) = last_insn;
+ PREV_INSN (insn) = get_last_insn();
NEXT_INSN (insn) = 0;
- if (NULL != last_insn)
- NEXT_INSN (last_insn) = insn;
+ if (NULL != get_last_insn())
+ NEXT_INSN (get_last_insn ()) = insn;
- if (NULL == first_insn)
- first_insn = insn;
+ if (NULL == get_insns ())
+ set_first_insn (insn);
- last_insn = insn;
+ set_last_insn (insn);
}
/* Add INSN into the doubly-linked list after insn AFTER. This and
if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE)
PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = insn;
}
- else if (last_insn == after)
- last_insn = insn;
+ else if (get_last_insn () == after)
+ set_last_insn (insn);
else
{
struct sequence_stack *stack = seq_stack;
NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = insn;
}
}
- else if (first_insn == before)
- first_insn = insn;
+ else if (get_insns () == before)
+ set_first_insn (insn);
else
{
struct sequence_stack *stack = seq_stack;
NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next;
}
}
- else if (first_insn == insn)
- first_insn = next;
+ else if (get_insns () == insn)
+ {
+ PREV_INSN (next) = NULL;
+ set_first_insn (next);
+ }
else
{
struct sequence_stack *stack = seq_stack;
if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE)
PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = prev;
}
- else if (last_insn == insn)
- last_insn = prev;
+ else if (get_last_insn () == insn)
+ set_last_insn (prev);
else
{
struct sequence_stack *stack = seq_stack;
delete_insns_since (rtx from)
{
if (from == 0)
- first_insn = 0;
+ set_first_insn (0);
else
NEXT_INSN (from) = 0;
- last_insn = from;
+ set_last_insn (from);
}
/* This function is deprecated, please use sequences instead.
NEXT_INSN (PREV_INSN (from)) = NEXT_INSN (to);
if (NEXT_INSN (to))
PREV_INSN (NEXT_INSN (to)) = PREV_INSN (from);
- if (last_insn == to)
- last_insn = PREV_INSN (from);
- if (first_insn == from)
- first_insn = NEXT_INSN (to);
+ if (get_last_insn () == to)
+ set_last_insn (PREV_INSN (from));
+ if (get_insns () == from)
+ set_first_insn (NEXT_INSN (to));
/* Make the new neighbors point to it and it to them. */
if (NEXT_INSN (after))
NEXT_INSN (to) = NEXT_INSN (after);
PREV_INSN (from) = after;
NEXT_INSN (after) = from;
- if (after == last_insn)
- last_insn = to;
+ if (after == get_last_insn())
+ set_last_insn (to);
}
/* Same as function above, but take care to update BB boundaries. */
if (after_after)
PREV_INSN (after_after) = last;
- if (after == last_insn)
- last_insn = last;
+ if (after == get_last_insn())
+ set_last_insn (last);
return last;
}
rtx
emit_insn (rtx x)
{
- rtx last = last_insn;
+ rtx last = get_last_insn();
rtx insn;
if (x == NULL_RTX)
rtx
emit_debug_insn (rtx x)
{
- rtx last = last_insn;
+ rtx last = get_last_insn();
rtx insn;
if (x == NULL_RTX)
tem = GGC_NEW (struct sequence_stack);
tem->next = seq_stack;
- tem->first = first_insn;
- tem->last = last_insn;
+ tem->first = get_insns ();
+ tem->last = get_last_insn ();
seq_stack = tem;
- first_insn = 0;
- last_insn = 0;
+ set_first_insn (0);
+ set_last_insn (0);
}
/* Set up the insn chain starting with FIRST as the current sequence,
for (last = first; last && NEXT_INSN (last); last = NEXT_INSN (last));
- first_insn = first;
- last_insn = last;
+ set_first_insn (first);
+ set_last_insn (last);
}
/* Like push_to_sequence, but take the last insn as an argument to avoid
{
start_sequence ();
- first_insn = first;
- last_insn = last;
+ set_first_insn (first);
+ set_last_insn (last);
}
/* Set up the outer-level insn chain
for (stack = seq_stack; stack; stack = stack->next)
top = stack;
- first_insn = top->first;
- last_insn = top->last;
+ set_first_insn (top->first);
+ set_last_insn (top->last);
}
/* After emitting to the outer-level insn chain, update the outer-level
for (stack = seq_stack; stack; stack = stack->next)
top = stack;
- top->first = first_insn;
- top->last = last_insn;
+ top->first = get_insns ();
+ top->last = get_last_insn ();
end_sequence ();
}
{
struct sequence_stack *tem = seq_stack;
- first_insn = tem->first;
- last_insn = tem->last;
+ set_first_insn (tem->first);
+ set_last_insn (tem->last);
seq_stack = tem->next;
memset (tem, 0, sizeof (*tem));
void
init_emit (void)
{
- first_insn = NULL;
- last_insn = NULL;
+ set_first_insn (NULL);
+ set_last_insn (NULL);
if (MIN_NONDEBUG_INSN_UID)
cur_insn_uid = MIN_NONDEBUG_INSN_UID;
else
/* Likewise, but the reference is not required to be valid. */
extern rtx replace_equiv_address_nv (rtx, rtx);
+extern rtx gen_blockage (void);
+extern rtvec gen_rtvec (int, ...);
+extern rtx copy_insn_1 (rtx);
+extern rtx copy_insn (rtx);
+extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
+extern rtx 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);
+extern void adjust_reg_mode (rtx, enum machine_mode);
+extern int mem_expr_equal_p (const_tree, const_tree);
+
+/* Return the first insn of the current sequence or current function. */
+
+static inline rtx
+get_insns (void)
+{
+ return crtl->emit.x_first_insn;
+}
+
+/* Specify a new insn as the first in the chain. */
+
+static inline void
+set_first_insn (rtx insn)
+{
+ gcc_assert (!insn || !PREV_INSN (insn));
+ crtl->emit.x_first_insn = insn;
+}
+
+/* Return the last insn emitted in current sequence or current function. */
+
+static inline rtx
+get_last_insn (void)
+{
+ return crtl->emit.x_last_insn;
+}
+
+/* Specify a new insn as the last in the chain. */
+
+static inline void
+set_last_insn (rtx insn)
+{
+ gcc_assert (!insn || !NEXT_INSN (insn));
+ crtl->emit.x_last_insn = insn;
+}
+
+/* Return a number larger than any instruction's uid in this function. */
+
+static inline int
+get_max_uid (void)
+{
+ return crtl->emit.x_cur_insn_uid;
+}
#endif /* GCC_EMIT_RTL_H */
#include "timevar.h"
#include "rtl.h"
#include "tm_p.h"
-#include "emit-rtl.h"
#include "insn-config.h"
#include "recog.h"
#include "flags.h"
#include "cfgloop.h"
#include "tree-pass.h"
#include "domwalk.h"
+#include "emit-rtl.h"
/* This pass does simple forward propagation and simplification when an
"#include \"insn-attr.h\"\n"
"#include \"toplev.h\"\n"
"#include \"flags.h\"\n"
- "#include \"function.h\"\n");
+ "#include \"function.h\"\n"
+ "#include \"emit-rtl.h\"\n");
+ /* FIXME: emit-rtl.h can go away once crtl is in rtl.h. */
write_automata ();
}
#include "basic-block.h"
#include "toplev.h"
#include "graph.h"
+#include "emit-rtl.h"
static const char *const graph_ext[] =
{
#include "dbgcnt.h"
#include "cfgloop.h"
#include "ira.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
#ifdef INSN_SCHEDULING
#include "reload.h"
#include "sparseset.h"
#include "ira-int.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
static ira_copy_t find_allocno_copy (ira_allocno_t, ira_allocno_t, rtx,
ira_loop_tree_node_t);
#include "tree-pass.h"
#include "timevar.h"
#include "df.h"
+#include "emit-rtl.h"
/* We want target macros for the mode switching code to be able to refer
to instruction attribute values. */
#include "target.h"
#include "df.h"
#include "vecprim.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
#ifdef STACK_REGS
}
-
/* 1 if RTX is a reg or parallel that is the current function's return
value. */
#define REG_FUNCTION_VALUE_P(RTX) \
extern HOST_WIDE_INT trunc_int_for_mode (HOST_WIDE_INT, enum machine_mode);
extern rtx plus_constant (rtx, HOST_WIDE_INT);
-/* In emit-rtl.c */
-extern rtx gen_blockage (void);
-extern rtvec gen_rtvec (int, ...);
-extern rtx copy_insn_1 (rtx);
-extern rtx copy_insn (rtx);
-extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
-extern rtx 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);
-extern void adjust_reg_mode (rtx, enum machine_mode);
-extern int mem_expr_equal_p (const_tree, const_tree);
-
/* In rtl.c */
extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL);
#define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO)
addr_space_t);
#define convert_memory_address(to_mode,x) \
convert_memory_address_addr_space ((to_mode), (x), ADDR_SPACE_GENERIC)
-extern rtx get_insns (void);
extern const char *get_insn_name (int);
-extern rtx get_last_insn (void);
extern rtx get_last_insn_anywhere (void);
extern rtx get_first_nonnote_insn (void);
extern rtx get_last_nonnote_insn (void);
extern void set_used_flags (rtx);
extern void reorder_insns (rtx, rtx, rtx);
extern void reorder_insns_nobb (rtx, rtx, rtx);
-extern int get_max_uid (void);
extern int get_max_insn_count (void);
extern int in_sequence_p (void);
extern void force_next_line_note (void);
extern void unshare_all_rtl_again (rtx);
extern void unshare_all_rtl_in_chain (rtx);
extern void verify_rtl_sharing (void);
-extern void set_first_insn (rtx);
-extern void set_last_insn (rtx);
extern void link_cc0_insns (rtx);
extern void add_insn (rtx);
extern void add_insn_before (rtx, rtx, struct basic_block_def *);
#include "function.h"
#include "df.h"
#include "tree.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
/* Forward declarations */
static void set_of_1 (rtx, const_rtx, void *);
#include "vec.h"
#include "langhooks.h"
#include "rtlhooks-def.h"
+#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
#ifdef INSN_SCHEDULING
#include "sel-sched-ir.h"
#include "langhooks.h"
#include "rtlhooks-def.h"
#include "output.h"
+#include "emit-rtl.h"
#ifdef INSN_SCHEDULING
#include "sel-sched-ir.h"