]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/opts.h
[Ada] Improved support for aspect alignment in CCG
[thirdparty/gcc.git] / gcc / opts.h
index 3c4065eae92b483b9ac2675de5189c6ea384879f..8f594b46e330b9ac5497035b93f19a39e2d4928c 100644 (file)
@@ -1,5 +1,5 @@
 /* Command line option handling.
-   Copyright (C) 2002-2018 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -36,6 +36,9 @@ enum cl_var_type {
   /* The switch is enabled when VAR_VALUE is set in FLAG_VAR.  */
   CLVC_BIT_SET,
 
+  /* The switch is enabled when FLAG_VAR is less than HOST_WIDE_INT_M1U.  */
+  CLVC_SIZE,
+
   /* The switch takes a string argument and FLAG_VAR points to that
      argument.  */
   CLVC_STRING,
@@ -70,7 +73,10 @@ struct cl_option
   unsigned short back_chain;
   /* Option length, not including initial '-'.  */
   unsigned char opt_len;
-  /* Next option in a sequence marked with Negative, or -1 if none.  */
+  /* Next option in a sequence marked with Negative, or -1 if none.
+     For a single option with both a negative and a positve form
+     (such as -Wall and -Wno-all), NEG_IDX is equal to the option's
+     own index (i.e., cl_options[IDX].neg_idx == IDX holds).  */
   int neg_index;
   /* CL_* flags for this option.  */
   unsigned int flags;
@@ -100,8 +106,8 @@ struct cl_option
   BOOL_BITFIELD cl_tolower : 1;
   /* Report argument with -fverbose-asm  */
   BOOL_BITFIELD cl_report : 1;
-  /* Deprecated option  */
-  BOOL_BITFIELD cl_deprecated: 1;
+  /* Argument is an unsigned integer with an optional byte suffix.  */
+  BOOL_BITFIELD cl_byte_size: 1;
   /* Offset of field for this option in struct gcc_options, or
      (unsigned short) -1 if none.  */
   unsigned short flag_var_offset;
@@ -211,7 +217,6 @@ extern const unsigned int cl_enums_count;
 #define CL_ERR_NEGATIVE                (1 << 6) /* Negative form of option
                                            not permitted (together
                                            with OPT_SPECIAL_unknown).  */
-#define CL_ERR_DEPRECATED      (1 << 7) /* Deprecated option.  */
 
 /* Structure describing the result of decoding an option.  */
 
@@ -247,7 +252,7 @@ struct cl_decoded_option
   /* For a boolean option, 1 for the true case and 0 for the "no-"
      case.  For an unsigned integer option, the value of the
      argument.  1 in all other cases.  */
-  int value;
+  HOST_WIDE_INT value;
 
   /* Any flags describing errors detected in this option.  */
   int errors;
@@ -327,7 +332,7 @@ extern char *opts_concat (const char *first, ...);
 extern struct obstack opts_obstack;
 
 size_t find_opt (const char *input, unsigned int lang_mask);
-extern int integral_argument (const char *arg);
+extern HOST_WIDE_INT integral_argument (const char *arg, int * = NULL, bool = false);
 extern bool enum_value_to_arg (const struct cl_enum_arg *enum_args,
                               const char **argp, int value,
                               unsigned int lang_mask);
@@ -340,7 +345,6 @@ extern void init_options_once (void);
 extern void init_options_struct (struct gcc_options *opts,
                                 struct gcc_options *opts_set);
 extern void init_opts_obstack (void);
-extern void finalize_options_struct (struct gcc_options *opts);
 extern void decode_cmdline_options_to_array_default_mask (unsigned int argc,
                                                          const char **argv, 
                                                          struct cl_decoded_option **decoded_options,
@@ -354,21 +358,23 @@ extern void decode_options (struct gcc_options *opts,
                            location_t loc,
                            diagnostic_context *dc,
                            void (*target_option_override_hook) (void));
-extern int option_enabled (int opt_idx, void *opts);
+extern int option_enabled (int opt_idx, unsigned lang_mask, void *opts);
+
 extern bool get_option_state (struct gcc_options *, int,
                              struct cl_option_state *);
 extern void set_option (struct gcc_options *opts,
                        struct gcc_options *opts_set,
-                       int opt_index, int value, const char *arg, int kind,
-                       location_t loc, diagnostic_context *dc);
+                       int opt_index, HOST_WIDE_INT value, const char *arg,
+                       int kind, location_t loc, diagnostic_context *dc);
 extern void *option_flag_var (int opt_index, struct gcc_options *opts);
 bool handle_generated_option (struct gcc_options *opts,
                              struct gcc_options *opts_set,
-                             size_t opt_index, const char *arg, int value,
+                             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);
-void generate_option (size_t opt_index, const char *arg, int value,
+void generate_option (size_t opt_index, const char *arg, HOST_WIDE_INT value,
                      unsigned int lang_mask,
                      struct cl_decoded_option *decoded);
 void generate_option_input_file (const char *file,
@@ -413,6 +419,8 @@ extern bool target_handle_option (struct gcc_options *opts,
 extern void finish_options (struct gcc_options *opts,
                            struct gcc_options *opts_set,
                            location_t loc);
+extern void print_help (struct gcc_options *opts, unsigned int lang_mask, const
+                       char *help_option_argument);
 extern void default_options_optimization (struct gcc_options *opts,
                                          struct gcc_options *opts_set,
                                          struct cl_decoded_option *decoded_options,
@@ -425,7 +433,8 @@ extern void set_struct_debug_option (struct gcc_options *opts,
                                     location_t loc,
                                     const char *value);
 extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg,
-                                  int *value, unsigned int lang_mask);
+                                  int *value,
+                                  unsigned int lang_mask);
 
 extern const struct sanitizer_opts_s
 {
@@ -435,6 +444,8 @@ extern const struct sanitizer_opts_s
   bool can_recover;
 } sanitizer_opts[];
 
+extern vec<const char *> help_option_arguments;
+
 extern void add_misspelling_candidates (auto_vec<char *> *candidates,
                                        const struct cl_option *option,
                                        const char *base_option);
@@ -442,4 +453,26 @@ extern const char *candidates_list_and_hint (const char *arg, char *&str,
                                             const auto_vec <const char *> &
                                             candidates);
 
+
+extern bool parse_and_check_align_values (const char *flag,
+                                         const char *name,
+                                         auto_vec<unsigned> &result_values,
+                                         bool report_error,
+                                         location_t loc);
+
+extern void parse_options_from_collect_gcc_options (const char *, obstack *,
+                                                   int *);
+
+extern void prepend_xassembler_to_collect_as_options (const char *, obstack *);
+
+/* Set OPTION in OPTS to VALUE if the option is not set in OPTS_SET.  */
+
+#define SET_OPTION_IF_UNSET(OPTS, OPTS_SET, OPTION, VALUE) \
+  do \
+  { \
+    if (!(OPTS_SET)->x_ ## OPTION) \
+      (OPTS)->x_ ## OPTION = VALUE; \
+  } \
+  while (false)
+
 #endif