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