1*e4b17023SJohn Marino /* Command line option handling. 2*e4b17023SJohn Marino Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 3*e4b17023SJohn Marino Free Software Foundation, Inc. 4*e4b17023SJohn Marino 5*e4b17023SJohn Marino This file is part of GCC. 6*e4b17023SJohn Marino 7*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under 8*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free 9*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later 10*e4b17023SJohn Marino version. 11*e4b17023SJohn Marino 12*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or 14*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15*e4b17023SJohn Marino for more details. 16*e4b17023SJohn Marino 17*e4b17023SJohn Marino You should have received a copy of the GNU General Public License 18*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see 19*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 20*e4b17023SJohn Marino 21*e4b17023SJohn Marino #ifndef GCC_OPTS_H 22*e4b17023SJohn Marino #define GCC_OPTS_H 23*e4b17023SJohn Marino 24*e4b17023SJohn Marino #include "input.h" 25*e4b17023SJohn Marino #include "vec.h" 26*e4b17023SJohn Marino 27*e4b17023SJohn Marino /* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */ 28*e4b17023SJohn Marino enum cl_var_type { 29*e4b17023SJohn Marino /* The switch is enabled when FLAG_VAR is nonzero. */ 30*e4b17023SJohn Marino CLVC_BOOLEAN, 31*e4b17023SJohn Marino 32*e4b17023SJohn Marino /* The switch is enabled when FLAG_VAR == VAR_VALUE. */ 33*e4b17023SJohn Marino CLVC_EQUAL, 34*e4b17023SJohn Marino 35*e4b17023SJohn Marino /* The switch is enabled when VAR_VALUE is not set in FLAG_VAR. */ 36*e4b17023SJohn Marino CLVC_BIT_CLEAR, 37*e4b17023SJohn Marino 38*e4b17023SJohn Marino /* The switch is enabled when VAR_VALUE is set in FLAG_VAR. */ 39*e4b17023SJohn Marino CLVC_BIT_SET, 40*e4b17023SJohn Marino 41*e4b17023SJohn Marino /* The switch takes a string argument and FLAG_VAR points to that 42*e4b17023SJohn Marino argument. */ 43*e4b17023SJohn Marino CLVC_STRING, 44*e4b17023SJohn Marino 45*e4b17023SJohn Marino /* The switch takes an enumerated argument (VAR_ENUM says what 46*e4b17023SJohn Marino enumeration) and FLAG_VAR points to that argument. */ 47*e4b17023SJohn Marino CLVC_ENUM, 48*e4b17023SJohn Marino 49*e4b17023SJohn Marino /* The switch should be stored in the VEC pointed to by FLAG_VAR for 50*e4b17023SJohn Marino later processing. */ 51*e4b17023SJohn Marino CLVC_DEFER 52*e4b17023SJohn Marino }; 53*e4b17023SJohn Marino 54*e4b17023SJohn Marino struct cl_option 55*e4b17023SJohn Marino { 56*e4b17023SJohn Marino /* Text of the option, including initial '-'. */ 57*e4b17023SJohn Marino const char *opt_text; 58*e4b17023SJohn Marino /* Help text for --help, or NULL. */ 59*e4b17023SJohn Marino const char *help; 60*e4b17023SJohn Marino /* Error message for missing argument, or NULL. */ 61*e4b17023SJohn Marino const char *missing_argument_error; 62*e4b17023SJohn Marino /* Warning to give when this option is used, or NULL. */ 63*e4b17023SJohn Marino const char *warn_message; 64*e4b17023SJohn Marino /* Argument of alias target when positive option given, or NULL. */ 65*e4b17023SJohn Marino const char *alias_arg; 66*e4b17023SJohn Marino /* Argument of alias target when negative option given, or NULL. */ 67*e4b17023SJohn Marino const char *neg_alias_arg; 68*e4b17023SJohn Marino /* Alias target, or N_OPTS if not an alias. */ 69*e4b17023SJohn Marino unsigned short alias_target; 70*e4b17023SJohn Marino /* Previous option that is an initial substring of this one, or 71*e4b17023SJohn Marino N_OPTS if none. */ 72*e4b17023SJohn Marino unsigned short back_chain; 73*e4b17023SJohn Marino /* Option length, not including initial '-'. */ 74*e4b17023SJohn Marino unsigned char opt_len; 75*e4b17023SJohn Marino /* Next option in a sequence marked with Negative, or -1 if none. */ 76*e4b17023SJohn Marino int neg_index; 77*e4b17023SJohn Marino /* CL_* flags for this option. */ 78*e4b17023SJohn Marino unsigned int flags; 79*e4b17023SJohn Marino /* Disabled in this configuration. */ 80*e4b17023SJohn Marino BOOL_BITFIELD cl_disabled : 1; 81*e4b17023SJohn Marino /* Options marked with CL_SEPARATE take a number of separate 82*e4b17023SJohn Marino arguments (1 to 4) that is one more than the number in this 83*e4b17023SJohn Marino bit-field. */ 84*e4b17023SJohn Marino unsigned int cl_separate_nargs : 2; 85*e4b17023SJohn Marino /* Option is an alias when used with separate argument. */ 86*e4b17023SJohn Marino BOOL_BITFIELD cl_separate_alias : 1; 87*e4b17023SJohn Marino /* Alias to negative form of option. */ 88*e4b17023SJohn Marino BOOL_BITFIELD cl_negative_alias : 1; 89*e4b17023SJohn Marino /* Option takes no argument in the driver. */ 90*e4b17023SJohn Marino BOOL_BITFIELD cl_no_driver_arg : 1; 91*e4b17023SJohn Marino /* Reject this option in the driver. */ 92*e4b17023SJohn Marino BOOL_BITFIELD cl_reject_driver : 1; 93*e4b17023SJohn Marino /* Reject no- form. */ 94*e4b17023SJohn Marino BOOL_BITFIELD cl_reject_negative : 1; 95*e4b17023SJohn Marino /* Missing argument OK (joined). */ 96*e4b17023SJohn Marino BOOL_BITFIELD cl_missing_ok : 1; 97*e4b17023SJohn Marino /* Argument is an integer >=0. */ 98*e4b17023SJohn Marino BOOL_BITFIELD cl_uinteger : 1; 99*e4b17023SJohn Marino /* Argument is a HOST_WIDE_INT. */ 100*e4b17023SJohn Marino BOOL_BITFIELD cl_host_wide_int : 1; 101*e4b17023SJohn Marino /* Argument should be converted to lowercase. */ 102*e4b17023SJohn Marino BOOL_BITFIELD cl_tolower : 1; 103*e4b17023SJohn Marino /* Report argument with -fverbose-asm */ 104*e4b17023SJohn Marino BOOL_BITFIELD cl_report : 1; 105*e4b17023SJohn Marino /* Offset of field for this option in struct gcc_options, or 106*e4b17023SJohn Marino (unsigned short) -1 if none. */ 107*e4b17023SJohn Marino unsigned short flag_var_offset; 108*e4b17023SJohn Marino /* Index in cl_enums of enum used for this option's arguments, for 109*e4b17023SJohn Marino CLVC_ENUM options. */ 110*e4b17023SJohn Marino unsigned short var_enum; 111*e4b17023SJohn Marino /* How this option's value is determined and sets a field. */ 112*e4b17023SJohn Marino enum cl_var_type var_type; 113*e4b17023SJohn Marino /* Value or bit-mask with which to set a field. */ 114*e4b17023SJohn Marino HOST_WIDE_INT var_value; 115*e4b17023SJohn Marino }; 116*e4b17023SJohn Marino 117*e4b17023SJohn Marino /* Records that the state of an option consists of SIZE bytes starting 118*e4b17023SJohn Marino at DATA. DATA might point to CH in some cases. */ 119*e4b17023SJohn Marino struct cl_option_state { 120*e4b17023SJohn Marino const void *data; 121*e4b17023SJohn Marino size_t size; 122*e4b17023SJohn Marino char ch; 123*e4b17023SJohn Marino }; 124*e4b17023SJohn Marino 125*e4b17023SJohn Marino extern const struct cl_option cl_options[]; 126*e4b17023SJohn Marino extern const unsigned int cl_options_count; 127*e4b17023SJohn Marino extern const char *const lang_names[]; 128*e4b17023SJohn Marino extern const unsigned int cl_lang_count; 129*e4b17023SJohn Marino 130*e4b17023SJohn Marino #define CL_PARAMS (1U << 16) /* Fake entry. Used to display --param info with --help. */ 131*e4b17023SJohn Marino #define CL_WARNING (1U << 17) /* Enables an (optional) warning message. */ 132*e4b17023SJohn Marino #define CL_OPTIMIZATION (1U << 18) /* Enables an (optional) optimization. */ 133*e4b17023SJohn Marino #define CL_DRIVER (1U << 19) /* Driver option. */ 134*e4b17023SJohn Marino #define CL_TARGET (1U << 20) /* Target-specific option. */ 135*e4b17023SJohn Marino #define CL_COMMON (1U << 21) /* Language-independent. */ 136*e4b17023SJohn Marino 137*e4b17023SJohn Marino #define CL_MIN_OPTION_CLASS CL_PARAMS 138*e4b17023SJohn Marino #define CL_MAX_OPTION_CLASS CL_COMMON 139*e4b17023SJohn Marino 140*e4b17023SJohn Marino /* From here on the bits describe attributes of the options. 141*e4b17023SJohn Marino Before this point the bits have described the class of the option. 142*e4b17023SJohn Marino This distinction is important because --help will not list options 143*e4b17023SJohn Marino which only have these higher bits set. */ 144*e4b17023SJohn Marino 145*e4b17023SJohn Marino #define CL_JOINED (1U << 22) /* If takes joined argument. */ 146*e4b17023SJohn Marino #define CL_SEPARATE (1U << 23) /* If takes a separate argument. */ 147*e4b17023SJohn Marino #define CL_UNDOCUMENTED (1U << 24) /* Do not output with --help. */ 148*e4b17023SJohn Marino 149*e4b17023SJohn Marino /* Flags for an enumerated option argument. */ 150*e4b17023SJohn Marino #define CL_ENUM_CANONICAL (1 << 0) /* Canonical for this value. */ 151*e4b17023SJohn Marino #define CL_ENUM_DRIVER_ONLY (1 << 1) /* Only accepted in the driver. */ 152*e4b17023SJohn Marino 153*e4b17023SJohn Marino /* Structure describing an enumerated option argument. */ 154*e4b17023SJohn Marino 155*e4b17023SJohn Marino struct cl_enum_arg 156*e4b17023SJohn Marino { 157*e4b17023SJohn Marino /* The argument text, or NULL at the end of the array. */ 158*e4b17023SJohn Marino const char *arg; 159*e4b17023SJohn Marino 160*e4b17023SJohn Marino /* The corresponding integer value. */ 161*e4b17023SJohn Marino int value; 162*e4b17023SJohn Marino 163*e4b17023SJohn Marino /* Flags associated with this argument. */ 164*e4b17023SJohn Marino unsigned int flags; 165*e4b17023SJohn Marino }; 166*e4b17023SJohn Marino 167*e4b17023SJohn Marino /* Structure describing an enumerated set of option arguments. */ 168*e4b17023SJohn Marino 169*e4b17023SJohn Marino struct cl_enum 170*e4b17023SJohn Marino { 171*e4b17023SJohn Marino /* Help text, or NULL if the values should not be listed in --help 172*e4b17023SJohn Marino output. */ 173*e4b17023SJohn Marino const char *help; 174*e4b17023SJohn Marino 175*e4b17023SJohn Marino /* Error message for unknown arguments, or NULL to use a generic 176*e4b17023SJohn Marino error. */ 177*e4b17023SJohn Marino const char *unknown_error; 178*e4b17023SJohn Marino 179*e4b17023SJohn Marino /* Array of possible values. */ 180*e4b17023SJohn Marino const struct cl_enum_arg *values; 181*e4b17023SJohn Marino 182*e4b17023SJohn Marino /* The size of the type used to store a value. */ 183*e4b17023SJohn Marino size_t var_size; 184*e4b17023SJohn Marino 185*e4b17023SJohn Marino /* Function to set a variable of this type. */ 186*e4b17023SJohn Marino void (*set) (void *var, int value); 187*e4b17023SJohn Marino 188*e4b17023SJohn Marino /* Function to get the value of a variable of this type. */ 189*e4b17023SJohn Marino int (*get) (const void *var); 190*e4b17023SJohn Marino }; 191*e4b17023SJohn Marino 192*e4b17023SJohn Marino extern const struct cl_enum cl_enums[]; 193*e4b17023SJohn Marino extern const unsigned int cl_enums_count; 194*e4b17023SJohn Marino 195*e4b17023SJohn Marino /* Possible ways in which a command-line option may be erroneous. 196*e4b17023SJohn Marino These do not include not being known at all; an option index of 197*e4b17023SJohn Marino OPT_SPECIAL_unknown is used for that. */ 198*e4b17023SJohn Marino 199*e4b17023SJohn Marino #define CL_ERR_DISABLED (1 << 0) /* Disabled in this configuration. */ 200*e4b17023SJohn Marino #define CL_ERR_MISSING_ARG (1 << 1) /* Argument required but missing. */ 201*e4b17023SJohn Marino #define CL_ERR_WRONG_LANG (1 << 2) /* Option for wrong language. */ 202*e4b17023SJohn Marino #define CL_ERR_UINT_ARG (1 << 3) /* Bad unsigned integer argument. */ 203*e4b17023SJohn Marino #define CL_ERR_ENUM_ARG (1 << 4) /* Bad enumerated argument. */ 204*e4b17023SJohn Marino #define CL_ERR_NEGATIVE (1 << 5) /* Negative form of option 205*e4b17023SJohn Marino not permitted (together 206*e4b17023SJohn Marino with OPT_SPECIAL_unknown). */ 207*e4b17023SJohn Marino 208*e4b17023SJohn Marino /* Structure describing the result of decoding an option. */ 209*e4b17023SJohn Marino 210*e4b17023SJohn Marino struct cl_decoded_option 211*e4b17023SJohn Marino { 212*e4b17023SJohn Marino /* The index of this option, or an OPT_SPECIAL_* value for 213*e4b17023SJohn Marino non-options and unknown options. */ 214*e4b17023SJohn Marino size_t opt_index; 215*e4b17023SJohn Marino 216*e4b17023SJohn Marino /* Any warning to give for use of this option, or NULL if none. */ 217*e4b17023SJohn Marino const char *warn_message; 218*e4b17023SJohn Marino 219*e4b17023SJohn Marino /* The string argument, or NULL if none. For OPT_SPECIAL_* cases, 220*e4b17023SJohn Marino the option or non-option command-line argument. */ 221*e4b17023SJohn Marino const char *arg; 222*e4b17023SJohn Marino 223*e4b17023SJohn Marino /* The original text of option plus arguments, with separate argv 224*e4b17023SJohn Marino elements concatenated into one string with spaces separating 225*e4b17023SJohn Marino them. This is for such uses as diagnostics and 226*e4b17023SJohn Marino -frecord-gcc-switches. */ 227*e4b17023SJohn Marino const char *orig_option_with_args_text; 228*e4b17023SJohn Marino 229*e4b17023SJohn Marino /* The canonical form of the option and its argument, for when it is 230*e4b17023SJohn Marino necessary to reconstruct argv elements (in particular, for 231*e4b17023SJohn Marino processing specs and passing options to subprocesses from the 232*e4b17023SJohn Marino driver). */ 233*e4b17023SJohn Marino const char *canonical_option[4]; 234*e4b17023SJohn Marino 235*e4b17023SJohn Marino /* The number of elements in the canonical form of the option and 236*e4b17023SJohn Marino arguments; always at least 1. */ 237*e4b17023SJohn Marino size_t canonical_option_num_elements; 238*e4b17023SJohn Marino 239*e4b17023SJohn Marino /* For a boolean option, 1 for the true case and 0 for the "no-" 240*e4b17023SJohn Marino case. For an unsigned integer option, the value of the 241*e4b17023SJohn Marino argument. 1 in all other cases. */ 242*e4b17023SJohn Marino int value; 243*e4b17023SJohn Marino 244*e4b17023SJohn Marino /* Any flags describing errors detected in this option. */ 245*e4b17023SJohn Marino int errors; 246*e4b17023SJohn Marino }; 247*e4b17023SJohn Marino 248*e4b17023SJohn Marino /* Structure describing an option deferred for handling after the main 249*e4b17023SJohn Marino option handlers. */ 250*e4b17023SJohn Marino 251*e4b17023SJohn Marino typedef struct 252*e4b17023SJohn Marino { 253*e4b17023SJohn Marino /* Elements from struct cl_decoded_option used for deferred 254*e4b17023SJohn Marino options. */ 255*e4b17023SJohn Marino size_t opt_index; 256*e4b17023SJohn Marino const char *arg; 257*e4b17023SJohn Marino int value; 258*e4b17023SJohn Marino } cl_deferred_option; 259*e4b17023SJohn Marino DEF_VEC_O(cl_deferred_option); 260*e4b17023SJohn Marino DEF_VEC_ALLOC_O(cl_deferred_option,heap); 261*e4b17023SJohn Marino 262*e4b17023SJohn Marino /* Structure describing a single option-handling callback. */ 263*e4b17023SJohn Marino 264*e4b17023SJohn Marino struct cl_option_handler_func 265*e4b17023SJohn Marino { 266*e4b17023SJohn Marino /* The function called to handle the option. */ 267*e4b17023SJohn Marino bool (*handler) (struct gcc_options *opts, 268*e4b17023SJohn Marino struct gcc_options *opts_set, 269*e4b17023SJohn Marino const struct cl_decoded_option *decoded, 270*e4b17023SJohn Marino unsigned int lang_mask, int kind, location_t loc, 271*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 272*e4b17023SJohn Marino diagnostic_context *dc); 273*e4b17023SJohn Marino 274*e4b17023SJohn Marino /* The mask that must have some bit in common with the flags for the 275*e4b17023SJohn Marino option for this particular handler to be used. */ 276*e4b17023SJohn Marino unsigned int mask; 277*e4b17023SJohn Marino }; 278*e4b17023SJohn Marino 279*e4b17023SJohn Marino /* Structure describing the callbacks used in handling options. */ 280*e4b17023SJohn Marino 281*e4b17023SJohn Marino struct cl_option_handlers 282*e4b17023SJohn Marino { 283*e4b17023SJohn Marino /* Callback for an unknown option to determine whether to give an 284*e4b17023SJohn Marino error for it, and possibly store information to diagnose the 285*e4b17023SJohn Marino option at a later point. Return true if an error should be 286*e4b17023SJohn Marino given, false otherwise. */ 287*e4b17023SJohn Marino bool (*unknown_option_callback) (const struct cl_decoded_option *decoded); 288*e4b17023SJohn Marino 289*e4b17023SJohn Marino /* Callback to handle, and possibly diagnose, an option for another 290*e4b17023SJohn Marino language. */ 291*e4b17023SJohn Marino void (*wrong_lang_callback) (const struct cl_decoded_option *decoded, 292*e4b17023SJohn Marino unsigned int lang_mask); 293*e4b17023SJohn Marino 294*e4b17023SJohn Marino /* The number of individual handlers. */ 295*e4b17023SJohn Marino size_t num_handlers; 296*e4b17023SJohn Marino 297*e4b17023SJohn Marino /* The handlers themselves. */ 298*e4b17023SJohn Marino struct cl_option_handler_func handlers[3]; 299*e4b17023SJohn Marino }; 300*e4b17023SJohn Marino 301*e4b17023SJohn Marino /* Input file names. */ 302*e4b17023SJohn Marino 303*e4b17023SJohn Marino extern const char **in_fnames; 304*e4b17023SJohn Marino 305*e4b17023SJohn Marino /* The count of input filenames. */ 306*e4b17023SJohn Marino 307*e4b17023SJohn Marino extern unsigned num_in_fnames; 308*e4b17023SJohn Marino 309*e4b17023SJohn Marino size_t find_opt (const char *input, unsigned int lang_mask); 310*e4b17023SJohn Marino extern int integral_argument (const char *arg); 311*e4b17023SJohn Marino extern bool enum_value_to_arg (const struct cl_enum_arg *enum_args, 312*e4b17023SJohn Marino const char **argp, int value, 313*e4b17023SJohn Marino unsigned int lang_mask); 314*e4b17023SJohn Marino extern void decode_cmdline_options_to_array (unsigned int argc, 315*e4b17023SJohn Marino const char **argv, 316*e4b17023SJohn Marino unsigned int lang_mask, 317*e4b17023SJohn Marino struct cl_decoded_option **decoded_options, 318*e4b17023SJohn Marino unsigned int *decoded_options_count); 319*e4b17023SJohn Marino extern void init_options_once (void); 320*e4b17023SJohn Marino extern void init_options_struct (struct gcc_options *opts, 321*e4b17023SJohn Marino struct gcc_options *opts_set); 322*e4b17023SJohn Marino extern void decode_cmdline_options_to_array_default_mask (unsigned int argc, 323*e4b17023SJohn Marino const char **argv, 324*e4b17023SJohn Marino struct cl_decoded_option **decoded_options, 325*e4b17023SJohn Marino unsigned int *decoded_options_count); 326*e4b17023SJohn Marino extern void set_default_handlers (struct cl_option_handlers *handlers); 327*e4b17023SJohn Marino extern void decode_options (struct gcc_options *opts, 328*e4b17023SJohn Marino struct gcc_options *opts_set, 329*e4b17023SJohn Marino struct cl_decoded_option *decoded_options, 330*e4b17023SJohn Marino unsigned int decoded_options_count, 331*e4b17023SJohn Marino location_t loc, 332*e4b17023SJohn Marino diagnostic_context *dc); 333*e4b17023SJohn Marino extern int option_enabled (int opt_idx, void *opts); 334*e4b17023SJohn Marino extern bool get_option_state (struct gcc_options *, int, 335*e4b17023SJohn Marino struct cl_option_state *); 336*e4b17023SJohn Marino extern void set_option (struct gcc_options *opts, 337*e4b17023SJohn Marino struct gcc_options *opts_set, 338*e4b17023SJohn Marino int opt_index, int value, const char *arg, int kind, 339*e4b17023SJohn Marino location_t loc, diagnostic_context *dc); 340*e4b17023SJohn Marino extern void *option_flag_var (int opt_index, struct gcc_options *opts); 341*e4b17023SJohn Marino bool handle_generated_option (struct gcc_options *opts, 342*e4b17023SJohn Marino struct gcc_options *opts_set, 343*e4b17023SJohn Marino size_t opt_index, const char *arg, int value, 344*e4b17023SJohn Marino unsigned int lang_mask, int kind, location_t loc, 345*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 346*e4b17023SJohn Marino diagnostic_context *dc); 347*e4b17023SJohn Marino void generate_option (size_t opt_index, const char *arg, int value, 348*e4b17023SJohn Marino unsigned int lang_mask, 349*e4b17023SJohn Marino struct cl_decoded_option *decoded); 350*e4b17023SJohn Marino void generate_option_input_file (const char *file, 351*e4b17023SJohn Marino struct cl_decoded_option *decoded); 352*e4b17023SJohn Marino extern void read_cmdline_option (struct gcc_options *opts, 353*e4b17023SJohn Marino struct gcc_options *opts_set, 354*e4b17023SJohn Marino struct cl_decoded_option *decoded, 355*e4b17023SJohn Marino location_t loc, 356*e4b17023SJohn Marino unsigned int lang_mask, 357*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 358*e4b17023SJohn Marino diagnostic_context *dc); 359*e4b17023SJohn Marino extern void control_warning_option (unsigned int opt_index, int kind, 360*e4b17023SJohn Marino bool imply, location_t loc, 361*e4b17023SJohn Marino unsigned int lang_mask, 362*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 363*e4b17023SJohn Marino struct gcc_options *opts, 364*e4b17023SJohn Marino struct gcc_options *opts_set, 365*e4b17023SJohn Marino diagnostic_context *dc); 366*e4b17023SJohn Marino extern void print_ignored_options (void); 367*e4b17023SJohn Marino extern void handle_common_deferred_options (void); 368*e4b17023SJohn Marino extern bool common_handle_option (struct gcc_options *opts, 369*e4b17023SJohn Marino struct gcc_options *opts_set, 370*e4b17023SJohn Marino const struct cl_decoded_option *decoded, 371*e4b17023SJohn Marino unsigned int lang_mask, int kind, 372*e4b17023SJohn Marino location_t loc, 373*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 374*e4b17023SJohn Marino diagnostic_context *dc); 375*e4b17023SJohn Marino extern bool target_handle_option (struct gcc_options *opts, 376*e4b17023SJohn Marino struct gcc_options *opts_set, 377*e4b17023SJohn Marino const struct cl_decoded_option *decoded, 378*e4b17023SJohn Marino unsigned int lang_mask, int kind, 379*e4b17023SJohn Marino location_t loc, 380*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 381*e4b17023SJohn Marino diagnostic_context *dc); 382*e4b17023SJohn Marino extern void finish_options (struct gcc_options *opts, 383*e4b17023SJohn Marino struct gcc_options *opts_set, 384*e4b17023SJohn Marino location_t loc); 385*e4b17023SJohn Marino extern void default_options_optimization (struct gcc_options *opts, 386*e4b17023SJohn Marino struct gcc_options *opts_set, 387*e4b17023SJohn Marino struct cl_decoded_option *decoded_options, 388*e4b17023SJohn Marino unsigned int decoded_options_count, 389*e4b17023SJohn Marino location_t loc, 390*e4b17023SJohn Marino unsigned int lang_mask, 391*e4b17023SJohn Marino const struct cl_option_handlers *handlers, 392*e4b17023SJohn Marino diagnostic_context *dc); 393*e4b17023SJohn Marino extern void set_struct_debug_option (struct gcc_options *opts, 394*e4b17023SJohn Marino location_t loc, 395*e4b17023SJohn Marino const char *value); 396*e4b17023SJohn Marino extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg, 397*e4b17023SJohn Marino int *value, unsigned int lang_mask); 398*e4b17023SJohn Marino #endif 399