GCC Middle and Back End API Reference
opts.h
Go to the documentation of this file.
1/* Command line option handling.
2 Copyright (C) 2002-2025 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_OPTS_H
21#define GCC_OPTS_H
22
23#include "rich-location.h"
24#include "obstack.h"
25#include "flag-types.h"
26
27/* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */
29 /* The switch is an integer value. */
31
32 /* The switch is enabled when FLAG_VAR == VAR_VALUE. */
34
35 /* The switch is enabled when VAR_VALUE is not set in FLAG_VAR. */
37
38 /* The switch is enabled when VAR_VALUE is set in FLAG_VAR. */
40
41 /* The switch is enabled when FLAG_VAR is less than HOST_WIDE_INT_M1U. */
43
44 /* The switch takes a string argument and FLAG_VAR points to that
45 argument. */
47
48 /* The switch takes an enumerated argument (VAR_ENUM says what
49 enumeration) and FLAG_VAR points to that argument. */
51
52 /* The switch should be stored in the VEC pointed to by FLAG_VAR for
53 later processing. */
55};
56
57/* Values for var_value member of CLVC_ENUM. */
59 /* Enum without EnumSet or EnumBitSet. */
61
62 /* EnumSet. */
64
65 /* EnumBitSet. */
67};
68
70{
71 /* Text of the option, including initial '-'. */
72 const char *opt_text;
73 /* Help text for --help, or NULL. */
74 const char *help;
75 /* Error message for missing argument, or NULL. */
77 /* Warning to give when this option is used, or NULL. */
78 const char *warn_message;
79 /* Argument of alias target when positive option given, or NULL. */
80 const char *alias_arg;
81 /* Argument of alias target when negative option given, or NULL. */
82 const char *neg_alias_arg;
83 /* Alias target, or N_OPTS if not an alias. */
84 unsigned short alias_target;
85 /* Previous option that is an initial substring of this one, or
86 N_OPTS if none. */
87 unsigned short back_chain;
88 /* Option length, not including initial '-'. */
89 unsigned char opt_len;
90 /* Next option in a sequence marked with Negative, or -1 if none.
91 For a single option with both a negative and a positve form
92 (such as -Wall and -Wno-all), NEG_IDX is equal to the option's
93 own index (i.e., cl_options[IDX].neg_idx == IDX holds). */
95 /* CL_* flags for this option. */
96 unsigned int flags;
97 /* Disabled in this configuration. */
99 /* Options marked with CL_SEPARATE take a number of separate
100 arguments (1 to 4) that is one more than the number in this
101 bit-field. */
102 unsigned int cl_separate_nargs : 2;
103 /* Option is an alias when used with separate argument. */
105 /* Alias to negative form of option. */
107 /* Option takes no argument in the driver. */
109 /* Reject this option in the driver. */
111 /* Reject no- form. */
113 /* Missing argument OK (joined). */
115 /* Argument is an integer >=0. */
117 /* Argument is a HOST_WIDE_INT. */
119 /* Argument should be converted to lowercase. */
121 /* Argument is an unsigned integer with an optional byte suffix. */
123 /* Offset of field for this option in struct gcc_options, or
124 (unsigned short) -1 if none. */
125 unsigned short flag_var_offset;
126 /* Index in cl_enums of enum used for this option's arguments, for
127 CLVC_ENUM options. */
128 unsigned short var_enum;
129 /* How this option's value is determined and sets a field. */
131 /* Value or bit-mask with which to set a field. */
132 HOST_WIDE_INT var_value;
133 /* Range info minimum, or -1. */
135 /* Range info maximum, or -1. */
137};
138
139struct cl_var
140{
141 /* Name of the variable. */
142 const char *var_name;
143 /* Offset of field for this var in struct gcc_options. */
144 unsigned short var_offset;
145};
146
147/* Records that the state of an option consists of SIZE bytes starting
148 at DATA. DATA might point to CH in some cases. */
150 const void *data;
151 size_t size;
152 char ch;
153};
154
155extern const struct cl_option cl_options[];
156extern const unsigned int cl_options_count;
157
158extern const char *
159get_opt_url_suffix (int option_index, unsigned lang_mask);
160
161#ifdef ENABLE_PLUGIN
162extern const struct cl_var cl_vars[];
163#endif
164extern const char *const lang_names[];
165extern const unsigned int cl_lang_count;
166
167#define CL_PARAMS (1U << 16) /* Fake entry. Used to display --param info with --help. */
168#define CL_WARNING (1U << 17) /* Enables an (optional) warning message. */
169#define CL_OPTIMIZATION (1U << 18) /* Enables an (optional) optimization. */
170#define CL_DRIVER (1U << 19) /* Driver option. */
171#define CL_TARGET (1U << 20) /* Target-specific option. */
172#define CL_COMMON (1U << 21) /* Language-independent. */
173
174#define CL_MIN_OPTION_CLASS CL_PARAMS
175#define CL_MAX_OPTION_CLASS CL_COMMON
176
177/* From here on the bits describe attributes of the options.
178 Before this point the bits have described the class of the option.
179 This distinction is important because --help will not list options
180 which only have these higher bits set. */
181
182#define CL_JOINED (1U << 22) /* If takes joined argument. */
183#define CL_SEPARATE (1U << 23) /* If takes a separate argument. */
184#define CL_UNDOCUMENTED (1U << 24) /* Do not output with --help. */
185#define CL_NO_DWARF_RECORD (1U << 25) /* Do not add to producer string. */
186#define CL_PCH_IGNORE (1U << 26) /* Do compare state for pch. */
187
188/* Flags for an enumerated option argument. */
189#define CL_ENUM_CANONICAL (1 << 0) /* Canonical for this value. */
190#define CL_ENUM_DRIVER_ONLY (1 << 1) /* Only accepted in the driver. */
191#define CL_ENUM_SET_SHIFT 2 /* Shift for enum set. */
192
193/* Structure describing an enumerated option argument. */
194
196{
197 /* The argument text, or NULL at the end of the array. */
198 const char *arg;
199
200 /* The corresponding integer value. */
201 int value;
202
203 /* Flags associated with this argument. */
204 unsigned int flags;
205};
206
207/* Structure describing an enumerated set of option arguments. */
208
210{
211 /* Help text, or NULL if the values should not be listed in --help
212 output. */
213 const char *help;
214
215 /* Error message for unknown arguments, or NULL to use a generic
216 error. */
217 const char *unknown_error;
218
219 /* Array of possible values. */
220 const struct cl_enum_arg *values;
221
222 /* The size of the type used to store a value. */
223 size_t var_size;
224
225 /* Function to set a variable of this type. */
226 void (*set) (void *var, int value);
227
228 /* Function to get the value of a variable of this type. */
229 int (*get) (const void *var);
230};
231
232extern const struct cl_enum cl_enums[];
233extern const unsigned int cl_enums_count;
234
235/* Possible ways in which a command-line option may be erroneous.
236 These do not include not being known at all; an option index of
237 OPT_SPECIAL_unknown is used for that. */
238
239#define CL_ERR_DISABLED (1 << 0) /* Disabled in this configuration. */
240#define CL_ERR_MISSING_ARG (1 << 1) /* Argument required but missing. */
241#define CL_ERR_WRONG_LANG (1 << 2) /* Option for wrong language. */
242#define CL_ERR_UINT_ARG (1 << 3) /* Bad unsigned integer argument. */
243#define CL_ERR_INT_RANGE_ARG (1 << 4) /* Bad unsigned integer argument. */
244#define CL_ERR_ENUM_ARG (1 << 5) /* Bad enumerated argument. */
245#define CL_ERR_NEGATIVE (1 << 6) /* Negative form of option
246 not permitted (together
247 with OPT_SPECIAL_unknown). */
248#define CL_ERR_ENUM_SET_ARG (1 << 7) /* Bad argument of enumerated set. */
249
250/* Structure describing the result of decoding an option. */
251
253{
254 /* The index of this option, or an OPT_SPECIAL_* value for
255 non-options and unknown options. */
256 size_t opt_index;
258 /* Any warning to give for use of this option, or NULL if none. */
259 const char *warn_message;
260
261 /* The string argument, or NULL if none. For OPT_SPECIAL_* cases,
262 the option or non-option command-line argument. */
263 const char *arg;
264
265 /* The original text of option plus arguments, with separate argv
266 elements concatenated into one string with spaces separating
267 them. This is for such uses as diagnostics and
268 -frecord-gcc-switches. */
269 const char *orig_option_with_args_text;
270
271 /* The canonical form of the option and its argument, for when it is
272 necessary to reconstruct argv elements (in particular, for
273 processing specs and passing options to subprocesses from the
274 driver). */
275 const char *canonical_option[4];
276
277 /* The number of elements in the canonical form of the option and
278 arguments; always at least 1. */
280
281 /* For a boolean option, 1 for the true case and 0 for the "no-"
282 case. For an unsigned integer option, the value of the
283 argument. For enum the value of the enumerator corresponding
284 to argument string. 1 in all other cases. */
285 HOST_WIDE_INT value;
286
287 /* For EnumSet the value mask. Variable should be changed to
288 value | (prev_value & ~mask). */
289 HOST_WIDE_INT mask;
291 /* Any flags describing errors detected in this option. */
292 int errors;
293};
294
295/* Structure describing an option deferred for handling after the main
296 option handlers. */
297
299{
300 /* Elements from struct cl_decoded_option used for deferred
301 options. */
302 size_t opt_index;
303 const char *arg;
304 HOST_WIDE_INT value;
305};
306
307/* Structure describing a single option-handling callback. */
308
311 /* The function called to handle the option. */
312 bool (*handler) (struct gcc_options *opts,
313 struct gcc_options *opts_set,
314 const struct cl_decoded_option *decoded,
315 unsigned int lang_mask, int kind, location_t loc,
316 const struct cl_option_handlers *handlers,
318 void (*target_option_override_hook) (void));
319
320 /* The mask that must have some bit in common with the flags for the
321 option for this particular handler to be used. */
322 unsigned int mask;
323};
324
325/* Structure describing the callbacks used in handling options. */
326
328{
329 /* Callback for an unknown option to determine whether to give an
330 error for it, and possibly store information to diagnose the
331 option at a later point. Return true if an error should be
332 given, false otherwise. */
333 bool (*unknown_option_callback) (const struct cl_decoded_option *decoded);
334
335 /* Callback to handle, and possibly diagnose, an option for another
336 language. */
337 void (*wrong_lang_callback) (const struct cl_decoded_option *decoded,
338 unsigned int lang_mask);
340 /* Target option override hook. */
341 void (*target_option_override_hook) (void);
343 /* The number of individual handlers. */
344 size_t num_handlers;
346 /* The handlers themselves. */
348};
349
350/* Hold command-line options associated with stack limitation. */
351extern const char *opt_fstack_limit_symbol_arg;
354
355/* Input file names. */
356
357extern const char **in_fnames;
358
359/* The count of input filenames. */
360
361extern unsigned num_in_fnames;
362
363extern char *opts_concat (const char *first, ...);
364
365/* Obstack for option strings. */
366
367extern struct obstack opts_obstack;
368
369size_t find_opt (const char *input, unsigned int lang_mask);
370extern HOST_WIDE_INT integral_argument (const char *arg, int * = NULL, bool = false);
371extern bool enum_value_to_arg (const struct cl_enum_arg *enum_args,
372 const char **argp, int value,
373 unsigned int lang_mask);
374extern void decode_cmdline_options_to_array (unsigned int argc,
375 const char **argv,
376 unsigned int lang_mask,
377 struct cl_decoded_option **decoded_options,
378 unsigned int *decoded_options_count);
379extern void init_options_once (void);
380extern void init_options_struct (struct gcc_options *opts,
381 struct gcc_options *opts_set);
382extern void init_opts_obstack (void);
383extern void decode_cmdline_options_to_array_default_mask (unsigned int argc,
384 const char **argv,
385 struct cl_decoded_option **decoded_options,
386 unsigned int *decoded_options_count);
387extern void set_default_handlers (struct cl_option_handlers *handlers,
388 void (*target_option_override_hook) (void));
389extern void decode_options (struct gcc_options *opts,
390 struct gcc_options *opts_set,
391 struct cl_decoded_option *decoded_options,
392 unsigned int decoded_options_count,
393 location_t loc,
395 void (*target_option_override_hook) (void));
396extern int option_enabled (int opt_idx, unsigned lang_mask, void *opts);
397
398extern bool get_option_state (struct gcc_options *, int,
399 struct cl_option_state *);
400extern void set_option (struct gcc_options *opts,
401 struct gcc_options *opts_set,
402 size_t opt_index, HOST_WIDE_INT value, const char *arg,
403 int kind, location_t loc, diagnostics::context *dc,
404 HOST_WIDE_INT = 0);
405extern void *option_flag_var (int opt_index, struct gcc_options *opts);
406bool handle_generated_option (struct gcc_options *opts,
407 struct gcc_options *opts_set,
408 size_t opt_index, const char *arg,
409 HOST_WIDE_INT value,
410 unsigned int lang_mask, int kind, location_t loc,
411 const struct cl_option_handlers *handlers,
412 bool generated_p, diagnostics::context *dc);
413void generate_option (size_t opt_index, const char *arg, HOST_WIDE_INT value,
414 unsigned int lang_mask,
415 struct cl_decoded_option *decoded);
416void generate_option_input_file (const char *file,
417 struct cl_decoded_option *decoded);
418extern void read_cmdline_option (struct gcc_options *opts,
419 struct gcc_options *opts_set,
420 struct cl_decoded_option *decoded,
421 location_t loc,
422 unsigned int lang_mask,
423 const struct cl_option_handlers *handlers,
425extern void control_warning_option (unsigned int opt_index, int kind,
426 const char *arg, bool imply, location_t loc,
427 unsigned int lang_mask,
428 const struct cl_option_handlers *handlers,
429 struct gcc_options *opts,
430 struct gcc_options *opts_set,
432extern char *write_langs (unsigned int mask);
433extern void print_ignored_options (void);
434extern void handle_common_deferred_options (void);
435extern void handle_deferred_dump_options (void);
436sanitize_code_type parse_sanitizer_options (const char *, location_t, int,
437 sanitize_code_type, int, bool);
438
440extern bool common_handle_option (struct gcc_options *opts,
441 struct gcc_options *opts_set,
442 const struct cl_decoded_option *decoded,
443 unsigned int lang_mask, int kind,
444 location_t loc,
445 const struct cl_option_handlers *handlers,
447 void (*target_option_override_hook) (void));
448extern bool target_handle_option (struct gcc_options *opts,
449 struct gcc_options *opts_set,
450 const struct cl_decoded_option *decoded,
451 unsigned int lang_mask, int kind,
452 location_t loc,
453 const struct cl_option_handlers *handlers,
455 void (*target_option_override_hook) (void));
456extern void finish_options (struct gcc_options *opts,
457 struct gcc_options *opts_set,
458 location_t loc);
459extern void diagnose_options (gcc_options *opts, gcc_options *opts_set,
460 location_t loc);
461extern void print_help (struct gcc_options *opts, unsigned int lang_mask, const
462 char *help_option_argument);
463extern void default_options_optimization (struct gcc_options *opts,
464 struct gcc_options *opts_set,
465 struct cl_decoded_option *decoded_options,
466 unsigned int decoded_options_count,
467 location_t loc,
468 unsigned int lang_mask,
469 const struct cl_option_handlers *handlers,
471extern void set_struct_debug_option (struct gcc_options *opts,
472 location_t loc,
473 const char *value);
474extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg,
475 int *value,
476 unsigned int lang_mask);
477
478extern const struct sanitizer_opts_s
480 const char *const name;
482 size_t len;
484 bool can_trap;
486
487extern const struct zero_call_used_regs_opts_s
489 const char *const name;
490 unsigned int flag;
492
494
495extern const char *get_option_prefix_remapping (const char *p, size_t sz,
496 const char **out_new_prefix);
497
499 const struct cl_option *option,
500 const char *base_option);
501extern const char *candidates_list_and_hint (const char *arg, char *&str,
502 const auto_vec <const char *> &
503 candidates);
504
505
506extern bool parse_and_check_align_values (const char *flag,
507 const char *name,
508 auto_vec<unsigned> &result_values,
509 bool report_error,
510 location_t loc);
511
512extern void parse_and_check_patch_area (const char *arg, bool report_error,
513 HOST_WIDE_INT *patch_area_size,
514 HOST_WIDE_INT *patch_area_start);
515
516extern void parse_options_from_collect_gcc_options (const char *, obstack *,
517 int *);
518
519extern void prepend_xassembler_to_collect_as_options (const char *, obstack *);
520
522 unsigned int options_count);
523extern char *gen_producer_string (const char *language_string,
525 unsigned int options_count);
526
527/* Set OPTION in OPTS to VALUE if the option is not set in OPTS_SET. */
528
529#define SET_OPTION_IF_UNSET(OPTS, OPTS_SET, OPTION, VALUE) \
530 do \
531 { \
532 if (!(OPTS_SET)->x_ ## OPTION) \
533 (OPTS)->x_ ## OPTION = VALUE; \
534 } \
535 while (false)
536
537/* Return true if OPTION is set by user in global options. */
538
539#define OPTION_SET_P(OPTION) global_options_set.x_ ## OPTION
540
541/* Find all the switches given to us
542 and make a vector describing them.
543 The elements of the vector are strings, one per switch given.
544 If a switch uses following arguments, then the `part1' field
545 is the switch itself and the `args' field
546 is a null-terminated vector containing the following arguments.
547 Bits in the `live_cond' field are:
548 SWITCH_LIVE to indicate this switch is true in a conditional spec.
549 SWITCH_FALSE to indicate this switch is overridden by a later switch.
550 SWITCH_IGNORE to indicate this switch should be ignored (used in %<S).
551 SWITCH_IGNORE_PERMANENTLY to indicate this switch should be ignored.
552 SWITCH_KEEP_FOR_GCC to indicate that this switch, otherwise ignored,
553 should be included in COLLECT_GCC_OPTIONS.
554 in all do_spec calls afterwards. Used for %<S from self specs.
555 The `known' field describes whether this is an internal switch.
556 The `validated' field describes whether any spec has looked at this switch;
557 if it remains false at the end of the run, the switch must be meaningless.
558 The `ordering' field is used to temporarily mark switches that have to be
559 kept in a specific order. */
561#define SWITCH_LIVE (1 << 0)
562#define SWITCH_FALSE (1 << 1)
563#define SWITCH_IGNORE (1 << 2)
564#define SWITCH_IGNORE_PERMANENTLY (1 << 3)
565#define SWITCH_KEEP_FOR_GCC (1 << 4)
566
569 const char *part1;
570 const char **args;
571 unsigned int live_cond;
572 bool known;
573 bool validated;
574 bool ordering;
575};
576
577extern label_text
578get_option_url_suffix (int option_index, unsigned lang_mask);
579
580#endif
Definition vec.h:1667
Definition diagnostics/context.h:253
uint64_t sanitize_code_type
Definition flag-types.h:354
static struct obstack obstack
Definition gcc.cc:364
static options_p option(options_p prev)
Definition gengtype-parse.cc:547
struct obstack opts_obstack
Definition opts-common.cc:987
unsigned num_in_fnames
Definition opts-global.cc:49
int opt_fstack_limit_register_no
Definition opts-global.cc:353
const char * opt_fstack_limit_symbol_arg
Definition opts-global.cc:352
const char ** in_fnames
Definition opts-global.cc:48
bool flag_stack_protector_set_by_fhardened_p
Definition opts.cc:48
const struct zero_call_used_regs_opts_s zero_call_used_regs_opts[]
Definition opts.cc:2179
const struct sanitizer_opts_s sanitizer_opts[]
Definition opts.cc:2130
vec< const char * > help_option_arguments
Definition opts.cc:991
const struct cl_option cl_options[]
cl_enum_var_value
Definition opts.h:58
@ CLEV_BITSET
Definition opts.h:66
@ CLEV_SET
Definition opts.h:63
@ CLEV_NORMAL
Definition opts.h:60
void set_option(struct gcc_options *opts, struct gcc_options *opts_set, size_t opt_index, HOST_WIDE_INT value, const char *arg, int kind, location_t loc, diagnostics::context *dc, HOST_WIDE_INT=0)
Definition opts-common.cc:1661
const unsigned int cl_enums_count
int option_enabled(int opt_idx, unsigned lang_mask, void *opts)
Definition opts-common.cc:1818
void handle_common_deferred_options(void)
Definition opts-global.cc:359
bool get_option_state(struct gcc_options *, int, struct cl_option_state *)
Definition opts-common.cc:1890
void finish_options(struct gcc_options *opts, struct gcc_options *opts_set, location_t loc)
Definition opts.cc:1070
void init_opts_obstack(void)
Definition opts.cc:427
const struct cl_enum cl_enums[]
HOST_WIDE_INT integral_argument(const char *arg, int *=NULL, bool=false)
Definition opts-common.cc:181
void diagnose_options(gcc_options *opts, gcc_options *opts_set, location_t loc)
Definition opts.cc:1507
size_t find_opt(const char *input, unsigned int lang_mask)
Definition opts-common.cc:77
void default_options_optimization(struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded_options, unsigned int decoded_options_count, location_t loc, unsigned int lang_mask, const struct cl_option_handlers *handlers, diagnostics::context *dc)
Definition opts.cc:728
void decode_cmdline_options_to_array_default_mask(unsigned int argc, const char **argv, struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count)
Definition opts-global.cc:279
void decode_options(struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded_options, unsigned int decoded_options_count, location_t loc, diagnostics::context *dc, void(*target_option_override_hook)(void))
Definition opts-global.cc:312
void * option_flag_var(int opt_index, struct gcc_options *opts)
Definition opts-common.cc:1804
void generate_option_input_file(const char *file, struct cl_decoded_option *decoded)
Definition opts-common.cc:1389
void parse_and_check_patch_area(const char *arg, bool report_error, HOST_WIDE_INT *patch_area_size, HOST_WIDE_INT *patch_area_start)
Definition opts.cc:2506
bool handle_generated_option(struct gcc_options *opts, struct gcc_options *opts_set, size_t opt_index, const char *arg, HOST_WIDE_INT value, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, bool generated_p, diagnostics::context *dc)
Definition opts-common.cc:1335
sanitize_code_type parse_no_sanitize_attribute(char *value)
Definition opts.cc:2383
void set_default_handlers(struct cl_option_handlers *handlers, void(*target_option_override_hook)(void))
Definition opts-global.cc:292
void add_misspelling_candidates(auto_vec< char * > *candidates, const struct cl_option *option, const char *base_option)
Definition opts-common.cc:515
bool opt_enum_arg_to_value(size_t opt_index, const char *arg, int *value, unsigned int lang_mask)
Definition opts-common.cc:325
const char *const lang_names[]
void prepend_xassembler_to_collect_as_options(const char *, obstack *)
Definition opts-common.cc:2072
cl_var_type
Definition opts.h:28
@ CLVC_BIT_CLEAR
Definition opts.h:36
@ CLVC_BIT_SET
Definition opts.h:39
@ CLVC_ENUM
Definition opts.h:50
@ CLVC_INTEGER
Definition opts.h:30
@ CLVC_DEFER
Definition opts.h:54
@ CLVC_EQUAL
Definition opts.h:33
@ CLVC_STRING
Definition opts.h:46
@ CLVC_SIZE
Definition opts.h:42
sanitize_code_type parse_sanitizer_options(const char *, location_t, int, sanitize_code_type, int, bool)
Definition opts.cc:2274
const unsigned int cl_lang_count
void handle_deferred_dump_options(void)
Definition opts-global.cc:507
void set_struct_debug_option(struct gcc_options *opts, location_t loc, const char *value)
Definition opts.cc:205
label_text get_option_url_suffix(int option_index, unsigned lang_mask)
Definition opts.cc:3816
void decode_cmdline_options_to_array(unsigned int argc, const char **argv, unsigned int lang_mask, struct cl_decoded_option **decoded_options, unsigned int *decoded_options_count)
Definition opts-common.cc:1029
const char * get_opt_url_suffix(int option_index, unsigned lang_mask)
char * gen_producer_string(const char *language_string, cl_decoded_option *options, unsigned int options_count)
Definition opts.cc:3984
bool target_handle_option(struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostics::context *dc, void(*target_option_override_hook)(void))
Definition opts.cc:365
const unsigned int cl_options_count
const char * get_option_prefix_remapping(const char *p, size_t sz, const char **out_new_prefix)
Definition opts-common.cc:477
void init_options_once(void)
Definition opts-global.cc:254
char * gen_command_line_string(cl_decoded_option *options, unsigned int options_count)
Definition opts.cc:3858
void init_options_struct(struct gcc_options *opts, struct gcc_options *opts_set)
Definition opts.cc:435
const char * candidates_list_and_hint(const char *arg, char *&str, const auto_vec< const char * > &candidates)
Definition opts-common.cc:1415
bool common_handle_option(struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostics::context *dc, void(*target_option_override_hook)(void))
Definition opts.cc:2707
void print_ignored_options(void)
Definition opts-global.cc:140
void control_warning_option(unsigned int opt_index, int kind, const char *arg, bool imply, location_t loc, unsigned int lang_mask, const struct cl_option_handlers *handlers, struct gcc_options *opts, struct gcc_options *opts_set, diagnostics::context *dc)
Definition opts-common.cc:1943
char * opts_concat(const char *first,...)
Definition opts-common.cc:992
void generate_option(size_t opt_index, const char *arg, HOST_WIDE_INT value, unsigned int lang_mask, struct cl_decoded_option *decoded)
Definition opts-common.cc:1354
void print_help(struct gcc_options *opts, unsigned int lang_mask, const char *help_option_argument)
Definition opts.cc:2565
char * write_langs(unsigned int mask)
Definition opts-global.cc:54
bool parse_and_check_align_values(const char *flag, const char *name, auto_vec< unsigned > &result_values, bool report_error, location_t loc)
Definition opts.cc:2436
bool enum_value_to_arg(const struct cl_enum_arg *enum_args, const char **argp, int value, unsigned int lang_mask)
Definition opts-common.cc:351
void parse_options_from_collect_gcc_options(const char *, obstack *, int *)
Definition opts-common.cc:2032
void read_cmdline_option(struct gcc_options *opts, struct gcc_options *opts_set, struct cl_decoded_option *decoded, location_t loc, unsigned int lang_mask, const struct cl_option_handlers *handlers, diagnostics::context *dc)
Definition opts-common.cc:1602
Definition opts.h:251
int errors
Definition opts.h:290
const char * arg
Definition opts.h:261
size_t canonical_option_num_elements
Definition opts.h:277
const char * canonical_option[4]
Definition opts.h:273
size_t opt_index
Definition opts.h:254
const char * orig_option_with_args_text
Definition opts.h:267
HOST_WIDE_INT value
Definition opts.h:283
const char * warn_message
Definition opts.h:257
HOST_WIDE_INT mask
Definition opts.h:287
Definition opts.h:297
size_t opt_index
Definition opts.h:300
HOST_WIDE_INT value
Definition opts.h:302
const char * arg
Definition opts.h:301
Definition opts.h:196
const char * arg
Definition opts.h:198
int value
Definition opts.h:201
unsigned int flags
Definition opts.h:204
Definition opts.h:210
const char * help
Definition opts.h:213
void(* set)(void *var, int value)
Definition opts.h:226
const struct cl_enum_arg * values
Definition opts.h:220
const char * unknown_error
Definition opts.h:217
int(* get)(const void *var)
Definition opts.h:229
size_t var_size
Definition opts.h:223
Definition opts.h:308
bool(* handler)(struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostics::context *dc, void(*target_option_override_hook)(void))
Definition opts.h:310
unsigned int mask
Definition opts.h:320
Definition opts.h:326
struct cl_option_handler_func handlers[3]
Definition opts.h:345
size_t num_handlers
Definition opts.h:342
void(* wrong_lang_callback)(const struct cl_decoded_option *decoded, unsigned int lang_mask)
Definition opts.h:335
void(* target_option_override_hook)(void)
Definition opts.h:339
bool(* unknown_option_callback)(const struct cl_decoded_option *decoded)
Definition opts.h:331
Definition opts.h:149
char ch
Definition opts.h:152
const void * data
Definition opts.h:150
size_t size
Definition opts.h:151
Definition opts.h:70
BOOL_BITFIELD cl_reject_driver
Definition opts.h:110
BOOL_BITFIELD cl_host_wide_int
Definition opts.h:118
unsigned short alias_target
Definition opts.h:84
unsigned short var_enum
Definition opts.h:128
BOOL_BITFIELD cl_reject_negative
Definition opts.h:112
unsigned short flag_var_offset
Definition opts.h:125
enum cl_var_type var_type
Definition opts.h:130
int range_max
Definition opts.h:136
const char * neg_alias_arg
Definition opts.h:82
BOOL_BITFIELD cl_no_driver_arg
Definition opts.h:108
const char * opt_text
Definition opts.h:72
int neg_index
Definition opts.h:94
BOOL_BITFIELD cl_tolower
Definition opts.h:120
BOOL_BITFIELD cl_missing_ok
Definition opts.h:114
BOOL_BITFIELD cl_separate_alias
Definition opts.h:104
HOST_WIDE_INT var_value
Definition opts.h:132
int range_min
Definition opts.h:134
const char * alias_arg
Definition opts.h:80
BOOL_BITFIELD cl_uinteger
Definition opts.h:116
const char * warn_message
Definition opts.h:78
BOOL_BITFIELD cl_byte_size
Definition opts.h:122
BOOL_BITFIELD cl_disabled
Definition opts.h:98
BOOL_BITFIELD cl_negative_alias
Definition opts.h:106
unsigned char opt_len
Definition opts.h:89
unsigned short back_chain
Definition opts.h:87
unsigned int cl_separate_nargs
Definition opts.h:102
unsigned int flags
Definition opts.h:96
const char * help
Definition opts.h:74
const char * missing_argument_error
Definition opts.h:76
Definition opts.h:140
const char * var_name
Definition opts.h:142
unsigned short var_offset
Definition opts.h:144
Definition gengtype.h:179
Definition opts.h:477
bool can_recover
Definition opts.h:481
sanitize_code_type flag
Definition opts.h:479
bool can_trap
Definition opts.h:482
const char *const name
Definition opts.h:478
size_t len
Definition opts.h:480
Definition opts.h:566
unsigned int live_cond
Definition opts.h:569
const char ** args
Definition opts.h:568
bool validated
Definition opts.h:571
bool ordering
Definition opts.h:572
const char * part1
Definition opts.h:567
bool known
Definition opts.h:570
Definition vec.h:450
Definition opts.h:486
const char *const name
Definition opts.h:487
unsigned int flag
Definition opts.h:488
#define NULL
Definition system.h:50
#define BOOL_BITFIELD
Definition system.h:896
#define bool
Definition system.h:886
static hash_table< uid_decl_hasher > * candidates
Definition tree-sra.cc:321