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