xref: /dflybsd-src/contrib/gcc-8.0/gcc/common/common-target.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj /* Data structure definitions for common hooks.
2*38fd1498Szrj    Copyright (C) 2010-2018 Free Software Foundation, Inc.
3*38fd1498Szrj 
4*38fd1498Szrj    This program is free software; you can redistribute it and/or modify it
5*38fd1498Szrj    under the terms of the GNU General Public License as published by the
6*38fd1498Szrj    Free Software Foundation; either version 3, or (at your option) any
7*38fd1498Szrj    later version.
8*38fd1498Szrj 
9*38fd1498Szrj    This program is distributed in the hope that it will be useful,
10*38fd1498Szrj    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*38fd1498Szrj    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*38fd1498Szrj    GNU General Public License for more details.
13*38fd1498Szrj 
14*38fd1498Szrj    You should have received a copy of the GNU General Public License
15*38fd1498Szrj    along with this program; see the file COPYING3.  If not see
16*38fd1498Szrj    <http://www.gnu.org/licenses/>.
17*38fd1498Szrj 
18*38fd1498Szrj    In other words, you are welcome to use, share and improve this program.
19*38fd1498Szrj    You are forbidden to forbid anyone else to use, share and improve
20*38fd1498Szrj    what you give them.   Help stamp out software-hoarding!  */
21*38fd1498Szrj 
22*38fd1498Szrj #ifndef GCC_COMMON_TARGET_H
23*38fd1498Szrj #define GCC_COMMON_TARGET_H
24*38fd1498Szrj 
25*38fd1498Szrj 
26*38fd1498Szrj /* Sets of optimization levels at which an option may be enabled by
27*38fd1498Szrj    default_options_optimization.  */
28*38fd1498Szrj enum opt_levels
29*38fd1498Szrj {
30*38fd1498Szrj   OPT_LEVELS_NONE, /* No levels (mark end of array).  */
31*38fd1498Szrj   OPT_LEVELS_ALL, /* All levels (used by targets to disable options
32*38fd1498Szrj 		     enabled in target-independent code).  */
33*38fd1498Szrj   OPT_LEVELS_0_ONLY, /* -O0 only.  */
34*38fd1498Szrj   OPT_LEVELS_1_PLUS, /* -O1 and above, including -Os and -Og.  */
35*38fd1498Szrj   OPT_LEVELS_1_PLUS_SPEED_ONLY, /* -O1 and above, but not -Os or -Og.  */
36*38fd1498Szrj   OPT_LEVELS_1_PLUS_NOT_DEBUG, /* -O1 and above, but not -Og.  */
37*38fd1498Szrj   OPT_LEVELS_2_PLUS, /* -O2 and above, including -Os.  */
38*38fd1498Szrj   OPT_LEVELS_2_PLUS_SPEED_ONLY, /* -O2 and above, but not -Os or -Og.  */
39*38fd1498Szrj   OPT_LEVELS_3_PLUS, /* -O3 and above.  */
40*38fd1498Szrj   OPT_LEVELS_3_PLUS_AND_SIZE, /* -O3 and above and -Os.  */
41*38fd1498Szrj   OPT_LEVELS_SIZE, /* -Os only.  */
42*38fd1498Szrj   OPT_LEVELS_FAST /* -Ofast only.  */
43*38fd1498Szrj };
44*38fd1498Szrj 
45*38fd1498Szrj /* Description of options to enable by default at given levels.  */
46*38fd1498Szrj struct default_options
47*38fd1498Szrj {
48*38fd1498Szrj   /* The levels at which to enable the option.  */
49*38fd1498Szrj   enum opt_levels levels;
50*38fd1498Szrj 
51*38fd1498Szrj   /* The option index and argument or enabled/disabled sense of the
52*38fd1498Szrj      option, as passed to handle_generated_option.  If ARG is NULL and
53*38fd1498Szrj      the option allows a negative form, the option is considered to be
54*38fd1498Szrj      passed in negative form when the optimization level is not one of
55*38fd1498Szrj      those in LEVELS (in order to handle changes to the optimization
56*38fd1498Szrj      level with the "optimize" attribute).  */
57*38fd1498Szrj   size_t opt_index;
58*38fd1498Szrj   const char *arg;
59*38fd1498Szrj   int value;
60*38fd1498Szrj };
61*38fd1498Szrj 
62*38fd1498Szrj #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
63*38fd1498Szrj #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS;
64*38fd1498Szrj #define DEFHOOK_UNDOC DEFHOOK
65*38fd1498Szrj #define HOOKSTRUCT(FRAGMENT) FRAGMENT
66*38fd1498Szrj 
67*38fd1498Szrj #include "common-target.def"
68*38fd1498Szrj 
69*38fd1498Szrj extern struct gcc_targetm_common targetm_common;
70*38fd1498Szrj 
71*38fd1498Szrj #endif /* GCC_C_TARGET_H */
72