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