]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/hooks.c
bfin.opt (mlong-calls): New.
[thirdparty/gcc.git] / gcc / hooks.c
CommitLineData
e4ec2cac 1/* General-purpose hooks.
bc7ffd06 2 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
e4ec2cac
AO
3
4This program is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, 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. */
32void
1d088dee 33hook_void_void (void)
e5f3b786
NB
34{
35}
36
e4ec2cac
AO
37/* Generic hook that takes no arguments and returns false. */
38bool
1d088dee 39hook_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. */
45bool
46hook_bool_void_true (void)
47{
48 return true;
49}
50
8c27b7d4 51/* Generic hook that takes no arguments and returns NO_REGS. */
a3424f5c
RH
52int
53hook_int_void_no_regs (void)
fe3ad572
SC
54{
55 return NO_REGS;
56}
57
58/* Generic hook that takes (bool) and returns false. */
59bool
60hook_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. */
66bool
67hook_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. */
73void
1d088dee 74hook_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. */
79bool
1d088dee
AJ
80hook_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
88bool
1d088dee
AJ
89hook_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
97bool
98hook_bool_constcharptr_size_t_false (const char *a ATTRIBUTE_UNUSED,
99 size_t b ATTRIBUTE_UNUSED)
100{
101 return false;
102}
103
75685792
RS
104bool
105hook_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 112bool
1d088dee
AJ
113default_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
121int
122hook_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. */
128int
1d088dee 129hook_int_tree_tree_1 (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
7b1bd3c5
RH
130{
131 return 1;
132}
133
dcefdf67 134int
1d088dee 135hook_int_rtx_0 (rtx a ATTRIBUTE_UNUSED)
dcefdf67
RH
136{
137 return 0;
138}
139
7fb26bb0
NB
140int
141hook_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
148unsigned int
149hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED,
150 const char **b ATTRIBUTE_UNUSED)
151{
152 return 0;
153}
154
7b1bd3c5 155void
1d088dee 156hook_void_tree (tree a ATTRIBUTE_UNUSED)
7b1bd3c5
RH
157{
158}
159
94d1613b 160void
8e3e233b 161hook_void_constcharptr (const char *a ATTRIBUTE_UNUSED)
94d1613b
MS
162{
163}
164
7b1bd3c5 165void
1d088dee 166hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
7b1bd3c5
RH
167{
168}
169
170bool
1d088dee 171hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
7b1bd3c5
RH
172{
173 return false;
174}
3a04ff64 175
c6e8c921
GK
176bool
177hook_bool_tree_true (tree a ATTRIBUTE_UNUSED)
178{
179 return true;
180}
181
4977bab6 182bool
1d088dee 183hook_bool_tree_tree_false (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
4977bab6
ZW
184{
185 return false;
186}
187
3a04ff64 188bool
1d088dee 189hook_bool_rtx_false (rtx a ATTRIBUTE_UNUSED)
3a04ff64
RH
190{
191 return false;
192}
3c50106f 193
a71a498d
AS
194bool
195hook_bool_rtx_true (rtx a ATTRIBUTE_UNUSED)
196{
197 return true;
198}
199
e129d93a
ILT
200bool
201hook_bool_uintp_uintp_false (unsigned int *a ATTRIBUTE_UNUSED,
202 unsigned int *b ATTRIBUTE_UNUSED)
203{
204 return false;
205}
206
3c50106f 207bool
1d088dee
AJ
208hook_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. */
217rtx
1d088dee 218hook_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. */
224rtx
1d088dee 225hook_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. */
231rtx
232hook_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 238tree
61158923
HPN
239hook_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. */
246const char *
247hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED)
248{
249 return NULL;
250}
55e74277
PB
251
252tree
a05a80fc
KH
253hook_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}