1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
/* d-target.def -- Target hook definitions for the D front end.
Copyright (C) 2017-2023 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* See target-hooks-macros.h for details of macros that should be
provided by the including file, and how to use them here. */
#include "target-hooks-macros.h"
#undef HOOK_TYPE
#define HOOK_TYPE "D Target Hook"
HOOK_VECTOR (TARGETDM_INITIALIZER, gcc_targetdm)
#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_"
/* Environmental version identifiers relating to the target CPU. */
DEFHOOK
(d_cpu_versions,
"Declare all environmental version identifiers relating to the target CPU\n\
using the function @code{builtin_version}, which takes a string representing\n\
the name of the version. Version identifiers predefined by this hook apply\n\
to all modules that are being compiled and imported.",
void, (void),
hook_void_void)
/* Environmental version identifiers relating to the target OS. */
DEFHOOK
(d_os_versions,
"Similarly to @code{TARGET_D_CPU_VERSIONS}, but is used for versions\n\
relating to the target operating system.",
void, (void),
hook_void_void)
/* getTargetInfo keys relating to the target CPU. */
DEFHOOK
(d_register_cpu_target_info,
"Register all target information keys relating to the target CPU using the\n\
function @code{d_add_target_info_handlers}, which takes a\n\
@samp{struct d_target_info_spec} (defined in @file{d/d-target.h}). The keys\n\
added by this hook are made available at compile time by the\n\
@code{__traits(getTargetInfo)} extension, the result is an expression\n\
describing the requested target information.",
void, (void),
hook_void_void)
/* getTargetInfo keys relating to the target OS. */
DEFHOOK
(d_register_os_target_info,
"Same as @code{TARGET_D_CPU_TARGET_INFO}, but is used for keys relating to\n\
the target operating system.",
void, (void),
hook_void_void)
/* ModuleInfo section name and brackets. */
DEFHOOKPOD
(d_minfo_section,
"Contains the name of the section in which module info references should be\n\
placed. By default, the compiler puts all module info symbols in the\n\
@code{\"minfo\"} section. Define this macro to override the string if a\n\
different section name should be used. This section is expected to be\n\
bracketed by two symbols @code{TARGET_D_MINFO_SECTION_START} and \n\
@code{TARGET_D_MINFO_SECTION_END} to indicate the start and end address of\n\
the section, so that the runtime library can collect all modules for each\n\
loaded shared library and executable. Setting the value to @code{NULL}\n\
disables the use of sections for storing module info altogether.",
const char *, "minfo")
DEFHOOKPOD
(d_minfo_section_start,
"If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined\n\
as the name of the symbol indicating the start address of the module info\n\
section",
const char *, "__start_minfo")
DEFHOOKPOD
(d_minfo_section_end,
"If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined\n\
as the name of the symbol indicating the end address of the module info\n\
section",
const char *, "__stop_minfo")
/* The "stdcall" convention is really supported on 32-bit x86/Windows only.
The following hook is a helper to determine whether to apply the attribute
on declarations with `extern(System)' and `extern(Windows)' linkage. */
DEFHOOK
(d_has_stdcall_convention,
"Returns @code{true} if the target supports the stdcall calling convention.\n\
The hook should also set @var{link_system} to @code{1} if the @code{stdcall}\n\
attribute should be applied to functions with @code{extern(System)} linkage,\n\
and @var{link_windows} to @code{1} to apply @code{stdcall} to functions with\n\
@code{extern(Windows)} linkage.",
bool, (unsigned int *link_system, unsigned int *link_windows),
hook_bool_uintp_uintp_false)
/* True if instantiations are always COMDAT if they have external linkage. */
DEFHOOKPOD
(d_templates_always_comdat,
"This flag is true if instantiated functions and variables are always COMDAT\n\
if they have external linkage. If this flag is false, then instantiated\n\
decls will be emitted as weak symbols. The default is @code{false}.",
bool, false)
/* Close the 'struct gcc_targetdm' definition. */
HOOK_VECTOR_END (C90_EMPTY_HACK)
|