]>
Commit | Line | Data |
---|---|---|
e78d8e51 | 1 | /* Definitions for code generation pass of GNU compiler. |
818ab71a | 2 | Copyright (C) 2001-2016 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 | { | |
9602f5a0 | 27 | LTI_abort, |
e78d8e51 ZW |
28 | LTI_memcpy, |
29 | LTI_memmove, | |
e78d8e51 | 30 | LTI_memcmp, |
e78d8e51 | 31 | LTI_memset, |
68d28100 | 32 | LTI_setbits, |
e78d8e51 | 33 | |
e78d8e51 ZW |
34 | LTI_setjmp, |
35 | LTI_longjmp, | |
36 | LTI_unwind_sjlj_register, | |
37 | LTI_unwind_sjlj_unregister, | |
38 | ||
e78d8e51 ZW |
39 | LTI_profile_function_entry, |
40 | LTI_profile_function_exit, | |
41 | ||
e2ff10a9 RS |
42 | LTI_synchronize, |
43 | ||
68d28100 | 44 | LTI_gcov_flush, |
68d28100 | 45 | |
e78d8e51 ZW |
46 | LTI_MAX |
47 | }; | |
48 | ||
5714c34f | 49 | /* Information about an optab-related libfunc. The op field is logically |
ef4bddc2 | 50 | an enum optab_d, and the mode fields are logically machine_mode. |
5714c34f RH |
51 | However, in the absence of forward-declared enums, there's no practical |
52 | benefit of pulling in the defining headers. | |
53 | ||
54 | We use the same hashtable for normal optabs and conversion optabs. In | |
55 | the first case mode2 is forced to VOIDmode. */ | |
56 | ||
2a22f99c | 57 | struct GTY((for_user)) libfunc_entry { |
5714c34f | 58 | int op, mode1, mode2; |
3e9c326a RS |
59 | rtx libfunc; |
60 | }; | |
61 | ||
2a22f99c TS |
62 | /* Descriptor for libfunc_entry. */ |
63 | ||
ca752f39 | 64 | struct libfunc_hasher : ggc_ptr_hash<libfunc_entry> |
2a22f99c TS |
65 | { |
66 | static hashval_t hash (libfunc_entry *); | |
67 | static bool equal (libfunc_entry *, libfunc_entry *); | |
68 | }; | |
69 | ||
3e9c326a RS |
70 | /* Target-dependent globals. */ |
71 | struct GTY(()) target_libfuncs { | |
72 | /* SYMBOL_REF rtx's for the library functions that are called | |
73 | implicitly and not via optabs. */ | |
74 | rtx x_libfunc_table[LTI_MAX]; | |
75 | ||
76 | /* Hash table used to convert declarations into nodes. */ | |
2a22f99c | 77 | hash_table<libfunc_hasher> *GTY(()) x_libfunc_hash; |
3e9c326a RS |
78 | }; |
79 | ||
80 | extern GTY(()) struct target_libfuncs default_target_libfuncs; | |
81 | #if SWITCHABLE_TARGET | |
82 | extern struct target_libfuncs *this_target_libfuncs; | |
83 | #else | |
84 | #define this_target_libfuncs (&default_target_libfuncs) | |
85 | #endif | |
86 | ||
87 | #define libfunc_table \ | |
88 | (this_target_libfuncs->x_libfunc_table) | |
e78d8e51 ZW |
89 | |
90 | /* Accessor macros for libfunc_table. */ | |
e78d8e51 | 91 | |
9602f5a0 | 92 | #define abort_libfunc (libfunc_table[LTI_abort]) |
e78d8e51 ZW |
93 | #define memcpy_libfunc (libfunc_table[LTI_memcpy]) |
94 | #define memmove_libfunc (libfunc_table[LTI_memmove]) | |
e78d8e51 | 95 | #define memcmp_libfunc (libfunc_table[LTI_memcmp]) |
e78d8e51 | 96 | #define memset_libfunc (libfunc_table[LTI_memset]) |
68d28100 | 97 | #define setbits_libfunc (libfunc_table[LTI_setbits]) |
e78d8e51 | 98 | |
e78d8e51 ZW |
99 | #define setjmp_libfunc (libfunc_table[LTI_setjmp]) |
100 | #define longjmp_libfunc (libfunc_table[LTI_longjmp]) | |
101 | #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register]) | |
102 | #define unwind_sjlj_unregister_libfunc \ | |
103 | (libfunc_table[LTI_unwind_sjlj_unregister]) | |
104 | ||
e78d8e51 ZW |
105 | #define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry]) |
106 | #define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit]) | |
107 | ||
e2ff10a9 RS |
108 | #define synchronize_libfunc (libfunc_table[LTI_synchronize]) |
109 | ||
68d28100 | 110 | #define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush]) |
68d28100 | 111 | |
d477d1fe SB |
112 | /* In explow.c */ |
113 | extern void set_stack_check_libfunc (const char *); | |
114 | ||
e78d8e51 | 115 | #endif /* GCC_LIBFUNCS_H */ |