d-target.h revision 1.1.1.3 1 1.1 mrg /* d-target.h -- Data structure definitions for target-specific D behavior.
2 1.1.1.3 mrg Copyright (C) 2017-2022 Free Software Foundation, Inc.
3 1.1 mrg
4 1.1 mrg This program is free software; you can redistribute it and/or modify it
5 1.1 mrg under the terms of the GNU General Public License as published by the
6 1.1 mrg Free Software Foundation; either version 3, or (at your option) any
7 1.1 mrg later version.
8 1.1 mrg
9 1.1 mrg This program is distributed in the hope that it will be useful,
10 1.1 mrg but WITHOUT ANY WARRANTY; without even the implied warranty of
11 1.1 mrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 1.1 mrg GNU General Public License for more details.
13 1.1 mrg
14 1.1 mrg You should have received a copy of the GNU General Public License
15 1.1 mrg along with this program; see the file COPYING3. If not see
16 1.1 mrg <http://www.gnu.org/licenses/>. */
17 1.1 mrg
18 1.1 mrg #ifndef GCC_D_TARGET_H
19 1.1 mrg #define GCC_D_TARGET_H
20 1.1 mrg
21 1.1 mrg #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
22 1.1 mrg #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
23 1.1 mrg #define DEFHOOK_UNDOC DEFHOOK
24 1.1 mrg #define HOOKSTRUCT(FRAGMENT) FRAGMENT
25 1.1 mrg
26 1.1 mrg #include "d-target.def"
27 1.1 mrg
28 1.1 mrg /* Each target can provide their own. */
29 1.1 mrg extern struct gcc_targetdm targetdm;
30 1.1 mrg
31 1.1 mrg /* Used by target to add predefined version idenditiers. */
32 1.1 mrg extern void d_add_builtin_version (const char *);
33 1.1 mrg
34 1.1.1.3 mrg /* Structure describing a supported key for `__traits(getTargetInfo)' and a
35 1.1.1.3 mrg function to handle it. */
36 1.1.1.3 mrg struct d_target_info_spec
37 1.1.1.3 mrg {
38 1.1.1.3 mrg /* The name of the key or NULL to mark the end of a table of keys. */
39 1.1.1.3 mrg const char *name;
40 1.1.1.3 mrg /* Function to handle this key, the return value of the handler must be a CST.
41 1.1.1.3 mrg This pointer may be NULL if no special handling is required, for instance,
42 1.1.1.3 mrg the key must always be available according to the D language spec. */
43 1.1.1.3 mrg tree (*handler) ();
44 1.1.1.3 mrg };
45 1.1.1.3 mrg
46 1.1.1.3 mrg /* Used by target to add getTargetInfo handlers. */
47 1.1.1.3 mrg extern void d_add_target_info_handlers (const d_target_info_spec *);
48 1.1.1.3 mrg
49 1.1 mrg #endif /* GCC_D_TARGET_H */
50