xref: /dflybsd-src/contrib/gcc-4.7/gcc/emit-rtl.h (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* Exported functions from emit-rtl.c
2*e4b17023SJohn Marino    Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
3*e4b17023SJohn Marino 
4*e4b17023SJohn Marino This file is part of GCC.
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under
7*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free
8*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later
9*e4b17023SJohn Marino version.
10*e4b17023SJohn Marino 
11*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or
13*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14*e4b17023SJohn Marino for more details.
15*e4b17023SJohn Marino 
16*e4b17023SJohn Marino You should have received a copy of the GNU General Public License
17*e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
18*e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
19*e4b17023SJohn Marino 
20*e4b17023SJohn Marino #ifndef GCC_EMIT_RTL_H
21*e4b17023SJohn Marino #define GCC_EMIT_RTL_H
22*e4b17023SJohn Marino 
23*e4b17023SJohn Marino /* Set the alias set of MEM to SET.  */
24*e4b17023SJohn Marino extern void set_mem_alias_set (rtx, alias_set_type);
25*e4b17023SJohn Marino 
26*e4b17023SJohn Marino /* Set the alignment of MEM to ALIGN bits.  */
27*e4b17023SJohn Marino extern void set_mem_align (rtx, unsigned int);
28*e4b17023SJohn Marino 
29*e4b17023SJohn Marino /* Set the address space of MEM to ADDRSPACE.  */
30*e4b17023SJohn Marino extern void set_mem_addr_space (rtx, addr_space_t);
31*e4b17023SJohn Marino 
32*e4b17023SJohn Marino /* Set the expr for MEM to EXPR.  */
33*e4b17023SJohn Marino extern void set_mem_expr (rtx, tree);
34*e4b17023SJohn Marino 
35*e4b17023SJohn Marino /* Set the offset for MEM to OFFSET.  */
36*e4b17023SJohn Marino extern void set_mem_offset (rtx, HOST_WIDE_INT);
37*e4b17023SJohn Marino 
38*e4b17023SJohn Marino /* Clear the offset recorded for MEM.  */
39*e4b17023SJohn Marino extern void clear_mem_offset (rtx);
40*e4b17023SJohn Marino 
41*e4b17023SJohn Marino /* Set the size for MEM to SIZE.  */
42*e4b17023SJohn Marino extern void set_mem_size (rtx, HOST_WIDE_INT);
43*e4b17023SJohn Marino 
44*e4b17023SJohn Marino /* Clear the size recorded for MEM.  */
45*e4b17023SJohn Marino extern void clear_mem_size (rtx);
46*e4b17023SJohn Marino 
47*e4b17023SJohn Marino /* Set the attributes for MEM appropriate for a spill slot.  */
48*e4b17023SJohn Marino extern void set_mem_attrs_for_spill (rtx);
49*e4b17023SJohn Marino extern tree get_spill_slot_decl (bool);
50*e4b17023SJohn Marino 
51*e4b17023SJohn Marino /* Return a memory reference like MEMREF, but with its address changed to
52*e4b17023SJohn Marino    ADDR.  The caller is asserting that the actual piece of memory pointed
53*e4b17023SJohn Marino    to is the same, just the form of the address is being changed, such as
54*e4b17023SJohn Marino    by putting something into a register.  */
55*e4b17023SJohn Marino extern rtx replace_equiv_address (rtx, rtx);
56*e4b17023SJohn Marino 
57*e4b17023SJohn Marino /* Likewise, but the reference is not required to be valid.  */
58*e4b17023SJohn Marino extern rtx replace_equiv_address_nv (rtx, rtx);
59*e4b17023SJohn Marino 
60*e4b17023SJohn Marino extern rtx gen_blockage (void);
61*e4b17023SJohn Marino extern rtvec gen_rtvec (int, ...);
62*e4b17023SJohn Marino extern rtx copy_insn_1 (rtx);
63*e4b17023SJohn Marino extern rtx copy_insn (rtx);
64*e4b17023SJohn Marino extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
65*e4b17023SJohn Marino extern rtx emit_copy_of_insn_after (rtx, rtx);
66*e4b17023SJohn Marino extern void set_reg_attrs_from_value (rtx, rtx);
67*e4b17023SJohn Marino extern void set_reg_attrs_for_parm (rtx, rtx);
68*e4b17023SJohn Marino extern void set_reg_attrs_for_decl_rtl (tree t, rtx x);
69*e4b17023SJohn Marino extern void adjust_reg_mode (rtx, enum machine_mode);
70*e4b17023SJohn Marino extern int mem_expr_equal_p (const_tree, const_tree);
71*e4b17023SJohn Marino 
72*e4b17023SJohn Marino /* Return the first insn of the current sequence or current function.  */
73*e4b17023SJohn Marino 
74*e4b17023SJohn Marino static inline rtx
get_insns(void)75*e4b17023SJohn Marino get_insns (void)
76*e4b17023SJohn Marino {
77*e4b17023SJohn Marino   return crtl->emit.x_first_insn;
78*e4b17023SJohn Marino }
79*e4b17023SJohn Marino 
80*e4b17023SJohn Marino /* Specify a new insn as the first in the chain.  */
81*e4b17023SJohn Marino 
82*e4b17023SJohn Marino static inline void
set_first_insn(rtx insn)83*e4b17023SJohn Marino set_first_insn (rtx insn)
84*e4b17023SJohn Marino {
85*e4b17023SJohn Marino   gcc_checking_assert (!insn || !PREV_INSN (insn));
86*e4b17023SJohn Marino   crtl->emit.x_first_insn = insn;
87*e4b17023SJohn Marino }
88*e4b17023SJohn Marino 
89*e4b17023SJohn Marino /* Return the last insn emitted in current sequence or current function.  */
90*e4b17023SJohn Marino 
91*e4b17023SJohn Marino static inline rtx
get_last_insn(void)92*e4b17023SJohn Marino get_last_insn (void)
93*e4b17023SJohn Marino {
94*e4b17023SJohn Marino   return crtl->emit.x_last_insn;
95*e4b17023SJohn Marino }
96*e4b17023SJohn Marino 
97*e4b17023SJohn Marino /* Specify a new insn as the last in the chain.  */
98*e4b17023SJohn Marino 
99*e4b17023SJohn Marino static inline void
set_last_insn(rtx insn)100*e4b17023SJohn Marino set_last_insn (rtx insn)
101*e4b17023SJohn Marino {
102*e4b17023SJohn Marino   gcc_checking_assert (!insn || !NEXT_INSN (insn));
103*e4b17023SJohn Marino   crtl->emit.x_last_insn = insn;
104*e4b17023SJohn Marino }
105*e4b17023SJohn Marino 
106*e4b17023SJohn Marino /* Return a number larger than any instruction's uid in this function.  */
107*e4b17023SJohn Marino 
108*e4b17023SJohn Marino static inline int
get_max_uid(void)109*e4b17023SJohn Marino get_max_uid (void)
110*e4b17023SJohn Marino {
111*e4b17023SJohn Marino   return crtl->emit.x_cur_insn_uid;
112*e4b17023SJohn Marino }
113*e4b17023SJohn Marino #endif /* GCC_EMIT_RTL_H */
114