]>
Commit | Line | Data |
---|---|---|
e78d8e51 | 1 | /* Definitions for code generation pass of GNU compiler. |
aeee4812 | 2 | Copyright (C) 2001-2023 Free Software Foundation, Inc. |
e78d8e51 | 3 | |
40803cd5 | 4 | This file is part of GCC. |
e78d8e51 | 5 | |
40803cd5 | 6 | GCC is free software; you can redistribute it and/or modify |
e78d8e51 | 7 | it under the terms of the GNU General Public License as published by |
9dcd6f09 | 8 | the Free Software Foundation; either version 3, or (at your option) |
e78d8e51 ZW |
9 | any later version. |
10 | ||
40803cd5 | 11 | GCC is distributed in the hope that it will be useful, |
e78d8e51 ZW |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
9dcd6f09 NC |
17 | along with GCC; see the file COPYING3. If not see |
18 | <http://www.gnu.org/licenses/>. */ | |
e78d8e51 ZW |
19 | |
20 | #ifndef GCC_LIBFUNCS_H | |
21 | #define GCC_LIBFUNCS_H | |
22 | ||
3e9c326a | 23 | |
e78d8e51 ZW |
24 | /* Enumeration of indexes into libfunc_table. */ |
25 | enum libfunc_index | |
26 | { | |
e78d8e51 ZW |
27 | LTI_unwind_sjlj_register, |
28 | LTI_unwind_sjlj_unregister, | |
e2ff10a9 | 29 | LTI_synchronize, |
e78d8e51 ZW |
30 | LTI_MAX |
31 | }; | |
32 | ||
5714c34f | 33 | /* Information about an optab-related libfunc. The op field is logically |
ef4bddc2 | 34 | an enum optab_d, and the mode fields are logically machine_mode. |
5714c34f RH |
35 | However, in the absence of forward-declared enums, there's no practical |
36 | benefit of pulling in the defining headers. | |
37 | ||
38 | We use the same hashtable for normal optabs and conversion optabs. In | |
39 | the first case mode2 is forced to VOIDmode. */ | |
40 | ||
2a22f99c | 41 | struct GTY((for_user)) libfunc_entry { |
5714c34f | 42 | int op, mode1, mode2; |
3e9c326a RS |
43 | rtx libfunc; |
44 | }; | |
45 | ||
2a22f99c TS |
46 | /* Descriptor for libfunc_entry. */ |
47 | ||
ca752f39 | 48 | struct libfunc_hasher : ggc_ptr_hash<libfunc_entry> |
2a22f99c TS |
49 | { |
50 | static hashval_t hash (libfunc_entry *); | |
51 | static bool equal (libfunc_entry *, libfunc_entry *); | |
52 | }; | |
53 | ||
3e9c326a RS |
54 | /* Target-dependent globals. */ |
55 | struct GTY(()) target_libfuncs { | |
56 | /* SYMBOL_REF rtx's for the library functions that are called | |
57 | implicitly and not via optabs. */ | |
58 | rtx x_libfunc_table[LTI_MAX]; | |
59 | ||
60 | /* Hash table used to convert declarations into nodes. */ | |
2a22f99c | 61 | hash_table<libfunc_hasher> *GTY(()) x_libfunc_hash; |
3e9c326a RS |
62 | }; |
63 | ||
64 | extern GTY(()) struct target_libfuncs default_target_libfuncs; | |
65 | #if SWITCHABLE_TARGET | |
66 | extern struct target_libfuncs *this_target_libfuncs; | |
67 | #else | |
68 | #define this_target_libfuncs (&default_target_libfuncs) | |
69 | #endif | |
70 | ||
71 | #define libfunc_table \ | |
72 | (this_target_libfuncs->x_libfunc_table) | |
e78d8e51 ZW |
73 | |
74 | /* Accessor macros for libfunc_table. */ | |
e78d8e51 | 75 | |
e78d8e51 ZW |
76 | #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register]) |
77 | #define unwind_sjlj_unregister_libfunc \ | |
78 | (libfunc_table[LTI_unwind_sjlj_unregister]) | |
e2ff10a9 RS |
79 | #define synchronize_libfunc (libfunc_table[LTI_synchronize]) |
80 | ||
e53b6e56 | 81 | /* In explow.cc */ |
d477d1fe SB |
82 | extern void set_stack_check_libfunc (const char *); |
83 | ||
e78d8e51 | 84 | #endif /* GCC_LIBFUNCS_H */ |