diff options
author | Martin Liska <mliska@suse.cz> | 2018-09-03 10:16:27 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-09-03 08:16:27 +0000 |
commit | c98c243078c380ad4c9a1ef08869d3b64abb128f (patch) | |
tree | f170c789ad3b3928dd6a9c1052207da98693895c /gcc/doc | |
parent | d1dfeff07917739fd5ae157be0825a757c576bef (diff) | |
download | gcc-c98c243078c380ad4c9a1ef08869d3b64abb128f.zip gcc-c98c243078c380ad4c9a1ef08869d3b64abb128f.tar.gz gcc-c98c243078c380ad4c9a1ef08869d3b64abb128f.tar.bz2 |
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
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/tm.texi | 4 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 551dc229..561bda3 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -5057,6 +5057,10 @@ Returns true if the target wants GCC's default stack protect runtime support, ot Whether this target supports splitting the stack when the options described in @var{opts} have been passed. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value @end deftypefn +@deftypefn {Common Target Hook} {vec<const char *>} TARGET_GET_VALID_OPTION_VALUES (int @var{option_code}, const char *@var{prefix}) +The hook is used for options that have a non-trivial list of possible option values. OPTION_CODE is option code of opt_code enum type. PREFIX is used for bash completion and allows an implementation to return more specific completion based on the prefix. All string values should be allocated from heap memory and consumers should release them. The result will be pruned to cases with PREFIX if not NULL. +@end deftypefn + @node Miscellaneous Register Hooks @subsection Miscellaneous register hooks @cindex miscellaneous register hooks diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 81a9adb..c509a9b 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -3669,6 +3669,8 @@ generic code. @hook TARGET_SUPPORTS_SPLIT_STACK +@hook TARGET_GET_VALID_OPTION_VALUES + @node Miscellaneous Register Hooks @subsection Miscellaneous register hooks @cindex miscellaneous register hooks |