GCC Middle and Back End API Reference
libfuncs.h
Go to the documentation of this file.
1/* Definitions for code generation pass of GNU compiler.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
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
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_LIBFUNCS_H
21#define GCC_LIBFUNCS_H
22
23
24/* Enumeration of indexes into libfunc_table. */
32
33/* Information about an optab-related libfunc. The op field is logically
34 an enum optab_d, and the mode fields are logically machine_mode.
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
41struct GTY((for_user)) libfunc_entry {
42 int op, mode1, mode2;
44};
45
46/* Descriptor for libfunc_entry. */
47
48struct libfunc_hasher : ggc_ptr_hash<libfunc_entry>
49{
50 static hashval_t hash (libfunc_entry *);
51 static bool equal (libfunc_entry *, libfunc_entry *);
52};
53
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. */
61 hash_table<libfunc_hasher> *GTY(()) x_libfunc_hash;
62};
63
65#if SWITCHABLE_TARGET
67#else
68#define this_target_libfuncs (&default_target_libfuncs)
69#endif
70
71#define libfunc_table \
72 (this_target_libfuncs->x_libfunc_table)
73
74/* Accessor macros for libfunc_table. */
75
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])
79#define synchronize_libfunc (libfunc_table[LTI_synchronize])
80
81/* In explow.cc */
82extern void set_stack_check_libfunc (const char *);
83
84#endif /* GCC_LIBFUNCS_H */
Definition hash-table.h:375
#define GTY(x)
Definition coretypes.h:41
void set_stack_check_libfunc(const char *libfunc_name)
Definition explow.cc:1700
void set_stack_check_libfunc(const char *)
Definition explow.cc:1700
libfunc_index
Definition libfuncs.h:26
@ LTI_synchronize
Definition libfuncs.h:29
@ LTI_unwind_sjlj_unregister
Definition libfuncs.h:28
@ LTI_MAX
Definition libfuncs.h:30
@ LTI_unwind_sjlj_register
Definition libfuncs.h:27
struct target_libfuncs default_target_libfuncs
Definition optabs-libfuncs.cc:35
#define this_target_libfuncs
Definition libfuncs.h:68
Definition hash-traits.h:321
Definition libfuncs.h:41
int mode2
Definition libfuncs.h:42
int op
Definition libfuncs.h:42
rtx libfunc
Definition libfuncs.h:43
int mode1
Definition libfuncs.h:42
Definition libfuncs.h:49
static hashval_t hash(libfunc_entry *)
Definition optabs-libfuncs.cc:53
static bool equal(libfunc_entry *, libfunc_entry *)
Definition optabs-libfuncs.cc:61
Definition rtl.h:312
Definition libfuncs.h:55
rtx x_libfunc_table[LTI_MAX]
Definition libfuncs.h:58
hash_table< libfunc_hasher > * x_libfunc_hash
Definition libfuncs.h:61