annotate gcc/target-hooks-macros.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
kono
parents:
diff changeset
1 /* Common macros for target hook definitions.
kono
parents:
diff changeset
2 Copyright (C) 2001-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
5 under the terms of the GNU General Public License as published by the
kono
parents:
diff changeset
6 Free Software Foundation; either version 3, or (at your option) any
kono
parents:
diff changeset
7 later version.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
kono
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
12 GNU General Public License for more details.
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
15 along with this program; see the file COPYING3. If not see
kono
parents:
diff changeset
16 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 /* The following macros should be provided by the including file:
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT): Define a function-valued hook.
kono
parents:
diff changeset
21 DEFHOOKPOD(NAME, DOC, TYPE, INIT): Define a piece-of-data 'hook'. */
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Defaults for optional macros:
kono
parents:
diff changeset
24 DEFHOOKPODX(NAME, TYPE, INIT): Like DEFHOOKPOD, but share documentation
kono
parents:
diff changeset
25 with the previous 'hook'. */
kono
parents:
diff changeset
26 #ifndef DEFHOOKPODX
kono
parents:
diff changeset
27 #define DEFHOOKPODX(NAME, TYPE, INIT) DEFHOOKPOD (NAME, 0, TYPE, INIT)
kono
parents:
diff changeset
28 #endif
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* HOOKSTRUCT(FRAGMENT): Declarator fragments to encapsulate all the
kono
parents:
diff changeset
31 members into a struct gcc_target, which in turn contains several
kono
parents:
diff changeset
32 sub-structs. */
kono
parents:
diff changeset
33 #ifndef HOOKSTRUCT
kono
parents:
diff changeset
34 #define HOOKSTRUCT(FRAGMENT)
kono
parents:
diff changeset
35 #endif
kono
parents:
diff changeset
36 /* HOOK_VECTOR: Start a struct declaration, which then gets its own initializer.
kono
parents:
diff changeset
37 HOOK_VECTOR_END: Close a struct declaration, providing a member declarator
kono
parents:
diff changeset
38 name for nested use. */
kono
parents:
diff changeset
39 #ifndef HOOK_VECTOR_1
kono
parents:
diff changeset
40 #define HOOK_VECTOR_1(NAME, FRAGMENT) HOOKSTRUCT (FRAGMENT)
kono
parents:
diff changeset
41 #endif
kono
parents:
diff changeset
42 #define HOOK_VECTOR(INIT_NAME, SNAME) HOOK_VECTOR_1 (INIT_NAME, struct SNAME {)
kono
parents:
diff changeset
43 #define HOOK_VECTOR_END(DECL_NAME) HOOK_VECTOR_1(,} DECL_NAME ;)
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 /* FIXME: For pre-existing hooks, we can't place the documentation in the
kono
parents:
diff changeset
46 documentation field here till we get permission from the FSF to include
kono
parents:
diff changeset
47 it in GPLed software - the target hook documentation is so far only
kono
parents:
diff changeset
48 available under the GFDL. */
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /* A hook should generally be documented by a string in the DOC parameter,
kono
parents:
diff changeset
51 which should contain texinfo markup. If the documentation is only available
kono
parents:
diff changeset
52 under the GPL, but not under the GFDL, put it in a comment above the hook
kono
parents:
diff changeset
53 definition. If the function declaration is available both under GPL and
kono
parents:
diff changeset
54 GFDL, but the documentation is only available under the GFDL, put the
kono
parents:
diff changeset
55 documentaton in tm.texi.in, heading with @hook <hookname> and closing
kono
parents:
diff changeset
56 the paragraph with @end deftypefn / deftypevr as appropriate, and marking
kono
parents:
diff changeset
57 the next autogenerated hook with @hook <hookname>.
kono
parents:
diff changeset
58 In both these cases, leave the DOC string empty, i.e. "".
kono
parents:
diff changeset
59 Sometimes, for some historic reason the function declaration
kono
parents:
diff changeset
60 has to be documented differently
kono
parents:
diff changeset
61 than what it is. In that case, use DEFHOOK_UNDOC to suppress auto-generation
kono
parents:
diff changeset
62 of documentation. DEFHOOK_UNDOC takes a DOC string which it ignores, so
kono
parents:
diff changeset
63 you can put GPLed documentation string there if you have hopes that you
kono
parents:
diff changeset
64 can clear the declaration & documentation for GFDL distribution later,
kono
parents:
diff changeset
65 in which case you can then simply change the DEFHOOK_UNDOC to DEFHOOK
kono
parents:
diff changeset
66 to turn on the autogeneration of the documentation.
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 A documentation string of "*" means not to emit any documentation at all,
kono
parents:
diff changeset
69 and is mainly used internally for DEFHOOK_UNDOC. It should generally not
kono
parents:
diff changeset
70 be used otherwise, but it has its use for exceptional cases where automatic
kono
parents:
diff changeset
71 documentation is not wanted, and the real documentation is elsewere, like
kono
parents:
diff changeset
72 for TARGET_ASM_{,UN}ALIGNED_INT_OP, which are hooks only for implementation
kono
parents:
diff changeset
73 purposes; they refer to structs, the components of which are documented as
kono
parents:
diff changeset
74 separate hooks TARGET_ASM_{,UN}ALIGNED_[HSDT]I_OP.
kono
parents:
diff changeset
75 A DOC string of 0 is for internal use of DEFHOOKPODX and special table
kono
parents:
diff changeset
76 entries only. */
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 /* Empty macro arguments are undefined in C90, so use an empty macro
kono
parents:
diff changeset
79 to close top-level hook structures. */
kono
parents:
diff changeset
80 #define C90_EMPTY_HACK