+2019-11-12 Martin Liska <mliska@suse.cz>
+
+ * common.opt: Remove --param and --param= options.
+ * opt-functions.awk: Mark CL_PARAMS for options
+ that have Param keyword.
+ * opts-common.c (decode_cmdline_options_to_array):
+ Replace --param key=value with --param=key=value.
+ * opts.c (print_filtered_help): Remove special
+ printing of params.
+ (print_specific_help): Update title for params.
+ (common_handle_option): Do not handle OPT__param.
+ opts.h (SET_OPTION_IF_UNSET): New macro.
+ * doc/options.texi: Document Param keyword.
+
2019-11-12 Maciej W. Rozycki <macro@codesourcery.com>
Frederik Harwath <frederik@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
fversion
Common Driver Alias(-version)
--param
-Common Separate
---param <param>=<value> Set parameter <param> to value. See below for a complete list of parameters.
-
--param=
-Common Joined Alias(-param)
-
-sysroot
Driver Separate Alias(-sysroot=)
option is not taken into account in ways that might affect executable
code generation.
+@item Param
+This is an option that is a parameter.
+
@item Undocumented
The option is deliberately missing documentation and should not
be included in the @option{--help} output.
test_flag("Undocumented", flags, " | CL_UNDOCUMENTED") \
test_flag("NoDWARFRecord", flags, " | CL_NO_DWARF_RECORD") \
test_flag("Warning", flags, " | CL_WARNING") \
- test_flag("(Optimization|PerFunction)", flags, " | CL_OPTIMIZATION")
+ test_flag("(Optimization|PerFunction)", flags, " | CL_OPTIMIZATION") \
+ test_flag("Param", flags, " | CL_PARAMS")
sub( "^0 \\| ", "", result )
return result
}
continue;
}
+ /* Interpret "--param" "key=name" as "--param=key=name". */
+ const char *needle = "--param";
+ if (i + 1 < argc && strcmp (opt, needle) == 0)
+ {
+ const char *replacement
+ = opts_concat (needle, "=", argv[i + 1], NULL);
+ argv[++i] = replacement;
+ }
+
n = decode_cmdline_option (argv + i, lang_mask,
&opt_array[num_decoded_options]);
num_decoded_options++;
bool displayed = false;
char new_help[256];
- if (include_flags == CL_PARAMS)
- {
- for (i = 0; i < LAST_PARAM; i++)
- {
- const char *param = compiler_params[i].option;
-
- help = compiler_params[i].help;
- if (help == NULL || *help == '\0')
- {
- if (exclude_flags & CL_UNDOCUMENTED)
- continue;
- help = undocumented_msg;
- }
-
- /* Get the translation. */
- help = _(help);
-
- if (!opts->x_quiet_flag)
- {
- snprintf (new_help, sizeof (new_help),
- _("default %d minimum %d maximum %d"),
- compiler_params[i].default_value,
- compiler_params[i].min_value,
- compiler_params[i].max_value);
- help = new_help;
- }
- wrap_help (help, param, strlen (param), columns);
- }
- putchar ('\n');
- return;
- }
-
if (!opts->x_help_printed)
opts->x_help_printed = XCNEWVAR (char, cl_options_count);
description = _("The following options are language-independent");
break;
case CL_PARAMS:
- description = _("The --param option recognizes the following as parameters");
+ description = _("The following options control parameters");
break;
default:
if (i >= cl_lang_count)
switch (code)
{
- case OPT__param:
- handle_param (opts, opts_set, loc, arg);
- break;
-
case OPT__help:
{
unsigned int all_langs_mask = (1U << cl_lang_count) - 1;
bool report_error,
location_t loc);
+/* 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