From 5936d944f8fffbb02f9c694645d37f60603a8a25 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 1 Jun 2010 17:49:37 +0200 Subject: fwprop.c: Make emit-rtl.h include last. * 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 --- gcc/emit-rtl.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'gcc/emit-rtl.h') diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index 01479e1..704f901 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -51,4 +51,57 @@ extern rtx replace_equiv_address (rtx, rtx); /* 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 */ -- cgit v1.1