]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/libfuncs.h
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
[thirdparty/gcc.git] / gcc / libfuncs.h
CommitLineData
d8fc4d0b 1/* Definitions for code generation pass of GNU compiler.
fbd26352 2 Copyright (C) 2001-2019 Free Software Foundation, Inc.
d8fc4d0b 3
049df704 4This file is part of GCC.
d8fc4d0b 5
049df704 6GCC is free software; you can redistribute it and/or modify
d8fc4d0b 7it under the terms of the GNU General Public License as published by
8c4c00c1 8the Free Software Foundation; either version 3, or (at your option)
d8fc4d0b 9any later version.
10
049df704 11GCC is distributed in the hope that it will be useful,
d8fc4d0b 12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
8c4c00c1 17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
d8fc4d0b 19
20#ifndef GCC_LIBFUNCS_H
21#define GCC_LIBFUNCS_H
22
d0f03375 23
d8fc4d0b 24/* Enumeration of indexes into libfunc_table. */
25enum libfunc_index
26{
d8fc4d0b 27 LTI_unwind_sjlj_register,
28 LTI_unwind_sjlj_unregister,
047a7e40 29 LTI_synchronize,
d8fc4d0b 30 LTI_MAX
31};
32
6eb29590 33/* Information about an optab-related libfunc. The op field is logically
3754d046 34 an enum optab_d, and the mode fields are logically machine_mode.
6eb29590 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
2ef51f0e 41struct GTY((for_user)) libfunc_entry {
6eb29590 42 int op, mode1, mode2;
d0f03375 43 rtx libfunc;
44};
45
2ef51f0e 46/* Descriptor for libfunc_entry. */
47
b594087e 48struct libfunc_hasher : ggc_ptr_hash<libfunc_entry>
2ef51f0e 49{
50 static hashval_t hash (libfunc_entry *);
51 static bool equal (libfunc_entry *, libfunc_entry *);
52};
53
d0f03375 54/* Target-dependent globals. */
55struct 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. */
2ef51f0e 61 hash_table<libfunc_hasher> *GTY(()) x_libfunc_hash;
d0f03375 62};
63
64extern GTY(()) struct target_libfuncs default_target_libfuncs;
65#if SWITCHABLE_TARGET
66extern 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)
d8fc4d0b 73
74/* Accessor macros for libfunc_table. */
d8fc4d0b 75
d8fc4d0b 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])
047a7e40 79#define synchronize_libfunc (libfunc_table[LTI_synchronize])
80
e3805e9e 81/* In explow.c */
82extern void set_stack_check_libfunc (const char *);
83
d8fc4d0b 84#endif /* GCC_LIBFUNCS_H */