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