1 /* Definitions for code generation pass of GNU compiler.
2 Copyright (C) 2001-2013 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
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.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_LIBFUNCS_H
21 #define GCC_LIBFUNCS_H
25 /* Enumeration of indexes into libfunc_table. */
37 LTI_unwind_sjlj_register
,
38 LTI_unwind_sjlj_unregister
,
40 LTI_profile_function_entry
,
41 LTI_profile_function_exit
,
50 /* Information about an optab-related libfunc. The op field is logically
51 an enum optab_d, and the mode fields are logically enum machine_mode.
52 However, in the absence of forward-declared enums, there's no practical
53 benefit of pulling in the defining headers.
55 We use the same hashtable for normal optabs and conversion optabs. In
56 the first case mode2 is forced to VOIDmode. */
58 struct GTY(()) libfunc_entry
{
63 /* Target-dependent globals. */
64 struct GTY(()) target_libfuncs
{
65 /* SYMBOL_REF rtx's for the library functions that are called
66 implicitly and not via optabs. */
67 rtx x_libfunc_table
[LTI_MAX
];
69 /* Hash table used to convert declarations into nodes. */
70 htab_t
GTY((param_is (struct libfunc_entry
))) x_libfunc_hash
;
73 extern GTY(()) struct target_libfuncs default_target_libfuncs
;
75 extern struct target_libfuncs
*this_target_libfuncs
;
77 #define this_target_libfuncs (&default_target_libfuncs)
80 #define libfunc_table \
81 (this_target_libfuncs->x_libfunc_table)
83 /* Accessor macros for libfunc_table. */
85 #define abort_libfunc (libfunc_table[LTI_abort])
86 #define memcpy_libfunc (libfunc_table[LTI_memcpy])
87 #define memmove_libfunc (libfunc_table[LTI_memmove])
88 #define memcmp_libfunc (libfunc_table[LTI_memcmp])
89 #define memset_libfunc (libfunc_table[LTI_memset])
90 #define setbits_libfunc (libfunc_table[LTI_setbits])
92 #define setjmp_libfunc (libfunc_table[LTI_setjmp])
93 #define longjmp_libfunc (libfunc_table[LTI_longjmp])
94 #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
95 #define unwind_sjlj_unregister_libfunc \
96 (libfunc_table[LTI_unwind_sjlj_unregister])
98 #define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
99 #define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
101 #define synchronize_libfunc (libfunc_table[LTI_synchronize])
103 #define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush])
106 extern void set_stack_check_libfunc (const char *);
108 #endif /* GCC_LIBFUNCS_H */