1 /* General-purpose hooks.
2 Copyright (C) 2002-2017 Free Software Foundation, Inc.
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 3, or (at your option) any
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.
14 You should have received a copy of the GNU General Public License
15 along with this program; see the file COPYING3. If not see
16 <http://www.gnu.org/licenses/>.
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! */
22 /* This file contains generic hooks that can be used as defaults for
23 target or language-dependent hook initializers. */
27 #include "coretypes.h"
31 /* Generic hook that does absolutely zappo. */
37 /* Generic hook that takes no arguments and returns false. */
39 hook_bool_void_false (void)
44 /* Generic hook that takes no arguments and returns true. */
46 hook_bool_void_true (void)
51 /* Generic hook that takes (bool) and returns false. */
53 hook_bool_bool_false (bool)
58 /* Generic hook that takes (bool, struct gcc_options *) and returns false. */
60 hook_bool_bool_gcc_optionsp_false (bool, struct gcc_options
*)
65 /* Generic hook that takes const int, const int) and returns true. */
66 bool hook_bool_const_int_const_int_true (const int, const int)
71 /* Generic hook that takes (machine_mode) and returns false. */
73 hook_bool_mode_false (machine_mode
)
78 /* Generic hook that takes (machine_mode) and returns true. */
80 hook_bool_mode_true (machine_mode
)
85 /* Generic hook that takes (machine_mode, const_rtx) and returns false. */
87 hook_bool_mode_const_rtx_false (machine_mode
, const_rtx
)
92 /* Generic hook that takes (machine_mode, const_rtx) and returns true. */
94 hook_bool_mode_const_rtx_true (machine_mode
, const_rtx
)
99 /* Generic hook that takes (machine_mode, rtx) and returns false. */
101 hook_bool_mode_rtx_false (machine_mode
, rtx
)
106 /* Generic hook that takes (machine_mode, rtx) and returns true. */
108 hook_bool_mode_rtx_true (machine_mode
, rtx
)
113 /* Generic hook that takes (const rtx_insn *, const rtx_insn *) and returns true. */
115 hook_bool_const_rtx_insn_const_rtx_insn_true (const rtx_insn
*,
121 /* Generic hook that takes (machine_mode, unsigned HOST_WIDE_INT)
122 and returns false. */
124 hook_bool_mode_uhwi_false (machine_mode
, unsigned HOST_WIDE_INT
)
129 /* Generic hook that takes (unsigned int, machine_mode) and returns false. */
131 hook_bool_uint_mode_false (unsigned int, machine_mode
)
136 /* Generic hook that takes (unsigned int, machine_mode) and returns true. */
138 hook_bool_uint_mode_true (unsigned int, machine_mode
)
143 /* Generic hook that takes (FILE *, const char *) and does nothing. */
145 hook_void_FILEptr_constcharptr (FILE *, const char *)
149 /* Generic hook that takes (FILE *, const char *, constr_tree *) and does
152 hook_void_FILEptr_constcharptr_const_tree (FILE *, const char *, const_tree
)
156 /* Generic hook that takes (FILE *, rtx) and returns false. */
158 hook_bool_FILEptr_rtx_false (FILE *, rtx
)
163 /* Generic hook that takes (gimple_stmt_iterator *) and returns
166 hook_bool_gsiptr_false (gimple_stmt_iterator
*)
171 /* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */
173 hook_bool_const_tree_hwi_hwi_const_tree_false (const_tree
, HOST_WIDE_INT
,
174 HOST_WIDE_INT
, const_tree
)
180 hook_bool_const_tree_hwi_hwi_const_tree_true (const_tree
, HOST_WIDE_INT
,
181 HOST_WIDE_INT
, const_tree
)
187 default_can_output_mi_thunk_no_vcall (const_tree
, HOST_WIDE_INT
,
188 HOST_WIDE_INT c
, const_tree
)
194 hook_int_uint_mode_1 (unsigned int, machine_mode
)
200 hook_int_const_tree_0 (const_tree
)
205 /* ??? Used for comp_type_attributes, which ought to return bool. */
207 hook_int_const_tree_const_tree_1 (const_tree
, const_tree
)
225 hook_int_rtx_insn_unreachable (rtx_insn
*)
231 hook_int_rtx_bool_0 (rtx
, bool)
237 hook_int_rtx_mode_as_bool_0 (rtx
, machine_mode
, addr_space_t
, bool)
243 hook_uint_void_0 (void)
249 hook_void_tree (tree
)
254 hook_void_rtx_tree (rtx
, tree
)
259 hook_void_constcharptr (const char *)
264 hook_void_tree_treeptr (tree
, tree
*)
269 hook_void_int_int (int, int)
274 hook_bool_tree_false (tree
)
280 hook_bool_const_tree_false (const_tree
)
286 hook_bool_tree_true (tree
)
292 hook_bool_const_tree_true (const_tree
)
298 hook_bool_tree_tree_false (tree
, tree
)
304 hook_bool_tree_tree_true (tree
, tree
)
310 hook_bool_tree_bool_false (tree
, bool)
316 hook_bool_rtx_insn_true (rtx_insn
*)
322 hook_bool_rtx_false (rtx
)
328 hook_bool_uintp_uintp_false (unsigned int *, unsigned int *)
334 hook_bool_rtx_mode_int_int_intp_bool_false (rtx
, machine_mode
, int, int,
341 hook_bool_wint_wint_uint_bool_true (const widest_int
&, const widest_int
&,
347 /* Generic hook that takes an rtx and returns it. */
349 hook_rtx_rtx_identity (rtx x
)
354 /* Generic hook that takes an rtx and returns NULL_RTX. */
356 hook_rtx_rtx_null (rtx
)
361 /* Generic hook that takes a tree and an int and returns NULL_RTX. */
363 hook_rtx_tree_int_null (tree
, int)
368 /* Generic hook that takes a machine mode and returns an unsigned int 0. */
370 hook_uint_mode_0 (machine_mode
)
375 /* Generic hook that takes no arguments and returns a NULL const string. */
377 hook_constcharptr_void_null (void)
382 /* Generic hook that takes no arguments and returns a NULL string. */
384 hook_charptr_void_null (void)
389 /* Generic hook that takes a tree and returns a NULL string. */
391 hook_constcharptr_const_tree_null (const_tree
)
397 hook_tree_tree_int_treep_bool_null (tree
, int, tree
*, bool)
403 hook_tree_tree_tree_null (tree
, tree
)
409 hook_tree_tree_tree_tree_null (tree
, tree
, tree
)
414 /* Generic hook that takes an rtx_insn *and returns a NULL string. */
416 hook_constcharptr_const_rtx_insn_null (const rtx_insn
*)
422 hook_constcharptr_const_tree_const_tree_null (const_tree
, const_tree
)
428 hook_constcharptr_int_const_tree_null (int, const_tree
)
434 hook_constcharptr_int_const_tree_const_tree_null (int, const_tree
, const_tree
)
439 /* Generic hook that takes a const_tree and returns NULL_TREE. */
441 hook_tree_const_tree_null (const_tree
)
446 /* Generic hook that takes no arguments and returns a NULL_TREE. */
448 hook_tree_void_null (void)
453 /* Generic hook that takes a rtx_insn * and an int and returns a bool. */
456 hook_bool_rtx_insn_int_false (rtx_insn
*, int)
461 /* Generic hook that takes a rtx_insn * and an int and returns void. */
464 hook_void_rtx_insn_int (rtx_insn
*, int)
468 /* Generic hook that takes a struct gcc_options * and returns void. */
471 hook_void_gcc_optionsp (struct gcc_options
*)
475 /* Generic hook that takes an unsigned int, an unsigned int pointer and
479 hook_bool_uint_uintp_false (unsigned int, unsigned int *)
484 /* Generic hook that takes a register class and returns false. */
486 hook_bool_reg_class_t_false (reg_class_t regclass ATTRIBUTE_UNUSED
)