]>
Commit | Line | Data |
---|---|---|
e4ec2cac | 1 | /* General-purpose hooks. |
bc7ffd06 | 2 | Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
e4ec2cac AO |
3 | |
4 | This program is free software; you can redistribute it and/or modify it | |
5 | under the terms of the GNU General Public License as published by the | |
6 | Free Software Foundation; either version 2, or (at your option) any | |
7 | later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
15 | along with this program; if not, write to the Free Software | |
16 | Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
17 | ||
18 | In other words, you are welcome to use, share and improve this program. | |
19 | You are forbidden to forbid anyone else to use, share and improve | |
20 | what you give them. Help stamp out software-hoarding! */ | |
21 | ||
22 | /* This file contains generic hooks that can be used as defaults for | |
23 | target or language-dependent hook initializers. */ | |
24 | ||
25 | #include "config.h" | |
26 | #include "system.h" | |
4977bab6 ZW |
27 | #include "coretypes.h" |
28 | #include "tm.h" | |
e4ec2cac AO |
29 | #include "hooks.h" |
30 | ||
e5f3b786 NB |
31 | /* Generic hook that does absolutely zappo. */ |
32 | void | |
1d088dee | 33 | hook_void_void (void) |
e5f3b786 NB |
34 | { |
35 | } | |
36 | ||
e4ec2cac AO |
37 | /* Generic hook that takes no arguments and returns false. */ |
38 | bool | |
1d088dee | 39 | hook_bool_void_false (void) |
ae46c4e0 RH |
40 | { |
41 | return false; | |
42 | } | |
fb49053f | 43 | |
af287697 MM |
44 | /* Generic hook that takes no arguments and returns true. */ |
45 | bool | |
46 | hook_bool_void_true (void) | |
47 | { | |
48 | return true; | |
49 | } | |
50 | ||
8c27b7d4 | 51 | /* Generic hook that takes no arguments and returns NO_REGS. */ |
a3424f5c RH |
52 | int |
53 | hook_int_void_no_regs (void) | |
fe3ad572 SC |
54 | { |
55 | return NO_REGS; | |
56 | } | |
57 | ||
58 | /* Generic hook that takes (bool) and returns false. */ | |
59 | bool | |
60 | hook_bool_bool_false (bool a ATTRIBUTE_UNUSED) | |
61 | { | |
62 | return false; | |
63 | } | |
64 | ||
f676971a EC |
65 | /* Generic hook that takes (enum machine_mode) and returns false. */ |
66 | bool | |
67 | hook_bool_mode_false (enum machine_mode mode ATTRIBUTE_UNUSED) | |
68 | { | |
69 | return false; | |
70 | } | |
71 | ||
5eb99654 KG |
72 | /* Generic hook that takes (FILE *, const char *) and does nothing. */ |
73 | void | |
1d088dee | 74 | hook_void_FILEptr_constcharptr (FILE *a ATTRIBUTE_UNUSED, const char *b ATTRIBUTE_UNUSED) |
5eb99654 KG |
75 | { |
76 | } | |
3961e8fe RH |
77 | |
78 | /* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */ | |
79 | bool | |
1d088dee AJ |
80 | hook_bool_tree_hwi_hwi_tree_false (tree a ATTRIBUTE_UNUSED, |
81 | HOST_WIDE_INT b ATTRIBUTE_UNUSED, | |
82 | HOST_WIDE_INT c ATTRIBUTE_UNUSED, | |
83 | tree d ATTRIBUTE_UNUSED) | |
3961e8fe RH |
84 | { |
85 | return false; | |
86 | } | |
87 | ||
88 | bool | |
1d088dee AJ |
89 | hook_bool_tree_hwi_hwi_tree_true (tree a ATTRIBUTE_UNUSED, |
90 | HOST_WIDE_INT b ATTRIBUTE_UNUSED, | |
91 | HOST_WIDE_INT c ATTRIBUTE_UNUSED, | |
92 | tree d ATTRIBUTE_UNUSED) | |
3961e8fe RH |
93 | { |
94 | return true; | |
95 | } | |
96 | ||
cb66e385 NB |
97 | bool |
98 | hook_bool_constcharptr_size_t_false (const char *a ATTRIBUTE_UNUSED, | |
99 | size_t b ATTRIBUTE_UNUSED) | |
100 | { | |
101 | return false; | |
102 | } | |
103 | ||
75685792 RS |
104 | bool |
105 | hook_bool_size_t_constcharptr_int_true (size_t a ATTRIBUTE_UNUSED, | |
106 | const char *b ATTRIBUTE_UNUSED, | |
107 | int c ATTRIBUTE_UNUSED) | |
108 | { | |
109 | return true; | |
110 | } | |
111 | ||
3961e8fe | 112 | bool |
1d088dee AJ |
113 | default_can_output_mi_thunk_no_vcall (tree a ATTRIBUTE_UNUSED, |
114 | HOST_WIDE_INT b ATTRIBUTE_UNUSED, | |
115 | HOST_WIDE_INT c, | |
116 | tree d ATTRIBUTE_UNUSED) | |
3961e8fe RH |
117 | { |
118 | return c == 0; | |
119 | } | |
7b1bd3c5 | 120 | |
a1c496cb EC |
121 | int |
122 | hook_int_tree_0 (tree a ATTRIBUTE_UNUSED) | |
123 | { | |
124 | return 0; | |
125 | } | |
126 | ||
7b1bd3c5 RH |
127 | /* ??? Used for comp_type_attributes, which ought to return bool. */ |
128 | int | |
1d088dee | 129 | hook_int_tree_tree_1 (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED) |
7b1bd3c5 RH |
130 | { |
131 | return 1; | |
132 | } | |
133 | ||
dcefdf67 | 134 | int |
1d088dee | 135 | hook_int_rtx_0 (rtx a ATTRIBUTE_UNUSED) |
dcefdf67 RH |
136 | { |
137 | return 0; | |
138 | } | |
139 | ||
7fb26bb0 NB |
140 | int |
141 | hook_int_size_t_constcharptr_int_0 (size_t a ATTRIBUTE_UNUSED, | |
142 | const char *b ATTRIBUTE_UNUSED, | |
143 | int c ATTRIBUTE_UNUSED) | |
144 | { | |
145 | return 0; | |
146 | } | |
147 | ||
b86f6cd9 NB |
148 | unsigned int |
149 | hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED, | |
150 | const char **b ATTRIBUTE_UNUSED) | |
151 | { | |
152 | return 0; | |
153 | } | |
154 | ||
7b1bd3c5 | 155 | void |
1d088dee | 156 | hook_void_tree (tree a ATTRIBUTE_UNUSED) |
7b1bd3c5 RH |
157 | { |
158 | } | |
159 | ||
94d1613b | 160 | void |
8e3e233b | 161 | hook_void_constcharptr (const char *a ATTRIBUTE_UNUSED) |
94d1613b MS |
162 | { |
163 | } | |
164 | ||
7b1bd3c5 | 165 | void |
1d088dee | 166 | hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED) |
7b1bd3c5 RH |
167 | { |
168 | } | |
169 | ||
170 | bool | |
1d088dee | 171 | hook_bool_tree_false (tree a ATTRIBUTE_UNUSED) |
7b1bd3c5 RH |
172 | { |
173 | return false; | |
174 | } | |
3a04ff64 | 175 | |
c6e8c921 GK |
176 | bool |
177 | hook_bool_tree_true (tree a ATTRIBUTE_UNUSED) | |
178 | { | |
179 | return true; | |
180 | } | |
181 | ||
4977bab6 | 182 | bool |
1d088dee | 183 | hook_bool_tree_tree_false (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED) |
4977bab6 ZW |
184 | { |
185 | return false; | |
186 | } | |
187 | ||
3a04ff64 | 188 | bool |
1d088dee | 189 | hook_bool_rtx_false (rtx a ATTRIBUTE_UNUSED) |
3a04ff64 RH |
190 | { |
191 | return false; | |
192 | } | |
3c50106f | 193 | |
a71a498d AS |
194 | bool |
195 | hook_bool_rtx_true (rtx a ATTRIBUTE_UNUSED) | |
196 | { | |
197 | return true; | |
198 | } | |
199 | ||
e129d93a ILT |
200 | bool |
201 | hook_bool_uintp_uintp_false (unsigned int *a ATTRIBUTE_UNUSED, | |
202 | unsigned int *b ATTRIBUTE_UNUSED) | |
203 | { | |
204 | return false; | |
205 | } | |
206 | ||
3c50106f | 207 | bool |
1d088dee AJ |
208 | hook_bool_rtx_int_int_intp_false (rtx a ATTRIBUTE_UNUSED, |
209 | int b ATTRIBUTE_UNUSED, | |
210 | int c ATTRIBUTE_UNUSED, | |
211 | int *d ATTRIBUTE_UNUSED) | |
3c50106f RH |
212 | { |
213 | return false; | |
214 | } | |
215 | ||
7daebb7a RS |
216 | /* Generic hook that takes an rtx and returns it. */ |
217 | rtx | |
1d088dee | 218 | hook_rtx_rtx_identity (rtx x) |
7daebb7a RS |
219 | { |
220 | return x; | |
221 | } | |
222 | ||
96714395 AH |
223 | /* Generic hook that takes an rtx and returns NULL_RTX. */ |
224 | rtx | |
1d088dee | 225 | hook_rtx_rtx_null (rtx x ATTRIBUTE_UNUSED) |
96714395 | 226 | { |
c6e8c921 GK |
227 | return NULL; |
228 | } | |
229 | ||
230 | /* Generic hook that takes a tree and an int and returns NULL_RTX. */ | |
231 | rtx | |
232 | hook_rtx_tree_int_null (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED) | |
233 | { | |
234 | return NULL; | |
96714395 | 235 | } |
18c81520 | 236 | |
61158923 | 237 | /* Generic hook that takes three trees and returns the last one as is. */ |
67dfe110 | 238 | tree |
61158923 HPN |
239 | hook_tree_tree_tree_tree_3rd_identity (tree a ATTRIBUTE_UNUSED, |
240 | tree b ATTRIBUTE_UNUSED, tree c) | |
67dfe110 | 241 | { |
61158923 | 242 | return c; |
67dfe110 | 243 | } |
f18eca82 ZL |
244 | |
245 | /* Generic hook that takes a tree and returns a NULL string. */ | |
246 | const char * | |
247 | hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED) | |
248 | { | |
249 | return NULL; | |
250 | } | |
55e74277 PB |
251 | |
252 | tree | |
a05a80fc KH |
253 | hook_tree_tree_tree_bool_null (tree t0 ATTRIBUTE_UNUSED, tree t1 ATTRIBUTE_UNUSED, |
254 | bool ignore ATTRIBUTE_UNUSED) | |
55e74277 PB |
255 | { |
256 | return NULL; | |
257 | } |