1/* General-purpose hooks.
2   Copyright (C) 2002-2015 Free Software Foundation, Inc.
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 3, 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; see the file COPYING3.  If not see
16   <http://www.gnu.org/licenses/>.
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#ifndef GCC_HOOKS_H
23#define GCC_HOOKS_H
24
25#include "machmode.h"
26#include "wide-int.h"
27
28extern bool hook_bool_void_false (void);
29extern bool hook_bool_void_true (void);
30extern bool hook_bool_bool_false (bool);
31extern bool hook_bool_bool_gcc_optionsp_false (bool, struct gcc_options *);
32extern bool hook_bool_const_int_const_int_true (const int, const int);
33extern bool hook_bool_mode_false (machine_mode);
34extern bool hook_bool_mode_true (machine_mode);
35extern bool hook_bool_mode_const_rtx_false (machine_mode, const_rtx);
36extern bool hook_bool_mode_const_rtx_true (machine_mode, const_rtx);
37extern bool hook_bool_mode_rtx_false (machine_mode, rtx);
38extern bool hook_bool_mode_rtx_true (machine_mode, rtx);
39extern bool hook_bool_const_rtx_insn_const_rtx_insn_true (const rtx_insn *,
40							  const rtx_insn *);
41extern bool hook_bool_mode_uhwi_false (machine_mode,
42				       unsigned HOST_WIDE_INT);
43extern bool hook_bool_tree_false (tree);
44extern bool hook_bool_const_tree_false (const_tree);
45extern bool hook_bool_tree_true (tree);
46extern bool hook_bool_const_tree_true (const_tree);
47extern bool hook_bool_gsiptr_false (gimple_stmt_iterator *);
48extern bool hook_bool_const_tree_hwi_hwi_const_tree_false (const_tree,
49							   HOST_WIDE_INT,
50							   HOST_WIDE_INT,
51							   const_tree);
52extern bool hook_bool_const_tree_hwi_hwi_const_tree_true (const_tree,
53							  HOST_WIDE_INT,
54							  HOST_WIDE_INT,
55							  const_tree);
56extern bool hook_bool_rtx_insn_true (rtx_insn *);
57extern bool hook_bool_rtx_false (rtx);
58extern bool hook_bool_rtx_insn_int_false (rtx_insn *, int);
59extern bool hook_bool_uintp_uintp_false (unsigned int *, unsigned int *);
60extern bool hook_bool_rtx_int_int_int_intp_bool_false (rtx, int, int, int,
61						       int *, bool);
62extern bool hook_bool_tree_tree_false (tree, tree);
63extern bool hook_bool_tree_tree_true (tree, tree);
64extern bool hook_bool_tree_bool_false (tree, bool);
65extern bool hook_bool_wint_wint_uint_bool_true (const widest_int &,
66						const widest_int &,
67						unsigned int, bool);
68
69extern void hook_void_void (void);
70extern void hook_void_constcharptr (const char *);
71extern void hook_void_rtx_insn_int (rtx_insn *, int);
72extern void hook_void_FILEptr_constcharptr (FILE *, const char *);
73extern void hook_void_FILEptr_constcharptr_const_tree (FILE *, const char *,
74						       const_tree);
75extern bool hook_bool_FILEptr_rtx_false (FILE *, rtx);
76extern void hook_void_rtx_tree (rtx, tree);
77extern void hook_void_tree (tree);
78extern void hook_void_tree_treeptr (tree, tree *);
79extern void hook_void_int_int (int, int);
80extern void hook_void_gcc_optionsp (struct gcc_options *);
81
82extern int hook_int_uint_mode_1 (unsigned int, machine_mode);
83extern int hook_int_const_tree_0 (const_tree);
84extern int hook_int_const_tree_const_tree_1 (const_tree, const_tree);
85extern int hook_int_rtx_0 (rtx);
86extern int hook_int_rtx_1 (rtx);
87extern int hook_int_rtx_insn_unreachable (rtx_insn *);
88extern int hook_int_rtx_bool_0 (rtx, bool);
89extern int hook_int_rtx_mode_as_bool_0 (rtx, machine_mode, addr_space_t,
90					bool);
91
92extern tree hook_tree_const_tree_null (const_tree);
93
94extern tree hook_tree_tree_tree_null (tree, tree);
95extern tree hook_tree_tree_tree_tree_null (tree, tree, tree);
96extern tree hook_tree_tree_tree_tree_3rd_identity (tree, tree, tree);
97extern tree hook_tree_tree_int_treep_bool_null (tree, int, tree *, bool);
98
99extern unsigned hook_uint_void_0 (void);
100extern unsigned int hook_uint_mode_0 (machine_mode);
101
102extern bool default_can_output_mi_thunk_no_vcall (const_tree, HOST_WIDE_INT,
103						  HOST_WIDE_INT, const_tree);
104
105extern rtx hook_rtx_rtx_identity (rtx);
106extern rtx hook_rtx_rtx_null (rtx);
107extern rtx hook_rtx_tree_int_null (tree, int);
108
109extern char *hook_charptr_void_null (void);
110extern const char *hook_constcharptr_void_null (void);
111extern const char *hook_constcharptr_const_tree_null (const_tree);
112extern const char *hook_constcharptr_const_rtx_insn_null (const rtx_insn *);
113extern const char *hook_constcharptr_const_tree_const_tree_null (const_tree, const_tree);
114extern const char *hook_constcharptr_int_const_tree_null (int, const_tree);
115extern const char *hook_constcharptr_int_const_tree_const_tree_null (int, const_tree, const_tree);
116#endif
117