diff options
author | Martin Liska <mliska@suse.cz> | 2019-11-12 11:09:57 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-11-12 10:09:57 +0000 |
commit | 8cc5fcaf1f04f8c7323181a53f05b34ed28a0f1a (patch) | |
tree | 87cfecfb1f2f7d58eb7d6ac38bb7c188f9feb367 /gcc/opts.c | |
parent | 0c29cac4a8cc840a0a597313147a7e0df0064c54 (diff) | |
download | gcc-8cc5fcaf1f04f8c7323181a53f05b34ed28a0f1a.zip gcc-8cc5fcaf1f04f8c7323181a53f05b34ed28a0f1a.tar.gz gcc-8cc5fcaf1f04f8c7323181a53f05b34ed28a0f1a.tar.bz2 |
Remove last leftover usage of params* files.
2019-11-12 Martin Liska <mliska@suse.cz>
* common.opt: Remove param_values.
* config/i386/i386-options.c (ix86_valid_target_attribute_p):
Remove finalize_options_struct.
* gcc.c (driver::decode_argv): Do not call global_init_params
and finish_params.
(driver::finalize): Do not call params_c_finalize
and finalize_options_struct.
* opt-suggestions.c (option_proposer::get_completions): Remove
special casing of params.
(option_proposer::find_param_completions): Remove.
(test_completion_partial_match): Update expected output.
* opt-suggestions.h: Remove find_param_completions.
* opts-common.c (add_misspelling_candidates): Add
--param with a space.
* opts.c (handle_param): Remove.
(init_options_struct):. Remove init_options_struct and
similar calls.
(finalize_options_struct): Remove.
(common_handle_option): Use SET_OPTION_IF_UNSET.
* opts.h (finalize_options_struct): Remove.
* toplev.c (general_init): Do not call global_init_params.
(toplev::finalize): Do not call params_c_finalize and
finalize_options_struct.
From-SVN: r278087
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 71 |
1 files changed, 4 insertions, 67 deletions
@@ -188,9 +188,6 @@ static const char use_diagnosed_msg[] = N_("Uses of this option are diagnosed.") typedef char *char_p; /* For DEF_VEC_P. */ -static void handle_param (struct gcc_options *opts, - struct gcc_options *opts_set, location_t loc, - const char *carg); static void set_debug_level (enum debug_info_type type, int extended, const char *arg, struct gcc_options *opts, struct gcc_options *opts_set, @@ -283,8 +280,6 @@ init_opts_obstack (void) void init_options_struct (struct gcc_options *opts, struct gcc_options *opts_set) { - size_t num_params = get_num_compiler_params (); - /* Ensure that opts_obstack has already been initialized by the time that we initialize any gcc_options instances (PR jit/68446). */ gcc_assert (opts_obstack.chunk_size > 0); @@ -294,13 +289,6 @@ init_options_struct (struct gcc_options *opts, struct gcc_options *opts_set) if (opts_set) memset (opts_set, 0, sizeof (*opts_set)); - opts->x_param_values = XNEWVEC (int, num_params); - - if (opts_set) - opts_set->x_param_values = XCNEWVEC (int, num_params); - - init_param_values (opts->x_param_values); - /* Initialize whether `char' is signed. */ opts->x_flag_signed_char = DEFAULT_SIGNED_CHAR; /* Set this to a special "uninitialized" value. The actual default @@ -318,14 +306,6 @@ init_options_struct (struct gcc_options *opts, struct gcc_options *opts_set) targetm_common.option_init_struct (opts); } -/* Release any allocations owned by OPTS. */ - -void -finalize_options_struct (struct gcc_options *opts) -{ - XDELETEVEC (opts->x_param_values); -} - /* If indicated by the optimization level LEVEL (-Os if SIZE is set, -Ofast if FAST is set, -Og if DEBUG is set), apply the option DEFAULT_OPT to OPTS and OPTS_SET, diagnostic context DC, location LOC, with language @@ -2465,10 +2445,10 @@ common_handle_option (struct gcc_options *opts, break; case OPT_finline_limit_: - set_param_value ("max-inline-insns-single", value / 2, - opts->x_param_values, opts_set->x_param_values); - set_param_value ("max-inline-insns-auto", value / 2, - opts->x_param_values, opts_set->x_param_values); + SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_single, + value / 2); + SET_OPTION_IF_UNSET (opts, opts_set, param_max_inline_insns_auto, + value / 2); break; case OPT_finstrument_functions_exclude_function_list_: @@ -2836,49 +2816,6 @@ common_handle_option (struct gcc_options *opts, return true; } -/* Handle --param NAME=VALUE. */ -static void -handle_param (struct gcc_options *opts, struct gcc_options *opts_set, - location_t loc, const char *carg) -{ - char *equal, *arg; - int value; - - arg = xstrdup (carg); - equal = strchr (arg, '='); - if (!equal) - error_at (loc, "%s: %qs arguments should be of the form NAME=VALUE", - arg, "--param"); - else - { - *equal = '\0'; - - enum compiler_param index; - if (!find_param (arg, &index)) - { - const char *suggestion = find_param_fuzzy (arg); - if (suggestion) - error_at (loc, "invalid %qs name %qs; did you mean %qs?", - "--param", arg, suggestion); - else - error_at (loc, "invalid %qs name %qs", "--param", arg); - } - else - { - if (!param_string_value_p (index, equal + 1, &value)) - value = integral_argument (equal + 1); - - if (value == -1) - error_at (loc, "invalid %qs value %qs", "--param", equal + 1); - else - set_param_value (arg, value, - opts->x_param_values, opts_set->x_param_values); - } - } - - free (arg); -} - /* Used to set the level of strict aliasing warnings in OPTS, when no level is specified (i.e., when -Wstrict-aliasing, and not -Wstrict-aliasing=level was given). |