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