Come up with TARGET_GET_VALID_OPTION_VALUES option hook (PR driver/83193).
authorMartin Liska <mliska@suse.cz>
Mon, 3 Sep 2018 08:16:27 +0000 (10:16 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 3 Sep 2018 08:16:27 +0000 (08:16 +0000)
commitc98c243078c380ad4c9a1ef08869d3b64abb128f
treef170c789ad3b3928dd6a9c1052207da98693895c
parentd1dfeff07917739fd5ae157be0825a757c576bef
Come up with TARGET_GET_VALID_OPTION_VALUES option hook (PR driver/83193).

2018-09-03  Martin Liska  <mliska@suse.cz>

        PR driver/83193
* common/common-target.def: Add TARGET_GET_VALID_OPTION_VALUES.
* common/common-targhooks.c (default_get_valid_option_values):
        New function.
* common/common-targhooks.h (default_get_valid_option_values):
        Likewise.
* common/config/i386/i386-common.c: Move processor_target_table
        from i386.c.
(ix86_get_valid_option_values): New function.
(TARGET_GET_VALID_OPTION_VALUES): New macro.
* config/i386/i386.c (struct ptt): Move to i386-common.c.
(PTA_*): Move all defined masks into i386-common.c.
(ix86_function_specific_restore): Use new processor_cost_table.
* config/i386/i386.h (struct ptt): Moved from i386.c.
(struct pta): Likewise.
* doc/tm.texi: Document new TARGET_GET_VALID_OPTION_VALUES.
* doc/tm.texi.in: Likewise.
* opt-suggestions.c (option_proposer::suggest_option):
        Pass prefix to build_option_suggestions.
(option_proposer::get_completions): Likewise.
(option_proposer::build_option_suggestions): Use the new target
        hook.
* opts.c (struct option_help_tuple): New struct.
(print_filtered_help): Use the new target hook.
2018-09-03  Martin Liska  <mliska@suse.cz>

        PR driver/83193
* gcc.dg/completion-4.c: New test.

From-SVN: r264052
14 files changed:
gcc/ChangeLog
gcc/common/common-target.def
gcc/common/common-targhooks.c
gcc/common/common-targhooks.h
gcc/common/config/i386/i386-common.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/opt-suggestions.c
gcc/opt-suggestions.h
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/completion-4.c [new file with mode: 0644]