diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-29 00:04:48 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-29 00:04:48 +0000 |
commit | 1eaf1dbefe219bcd5f1b87d32863a7f92bda154d (patch) | |
tree | 817e0bd186b25372de8bb48878056440c3f75bfb /gcc/optc-gen.awk | |
parent | 85ac1c40b2529d4be5e3e9572778ab8d06e00f76 (diff) | |
download | gcc-1eaf1dbefe219bcd5f1b87d32863a7f92bda154d.tar.gz |
2014-11-29 Tobias Burnus <burnus@net-b.de>
Manuel López-Ibáñez <manu@gcc.gnu.org>
gcc/
* opt-functions.awk (lang_enabled_by): Support || for
enabled-by.
* optc-gen.awk: Ditto.
* doc/options.texi (LangEnabledBy, EnabledBy): Document the
|| syntax.
gcc/fortran/
* lang.opt (Wtabs): Combine duplicated item into a single
one using || for LangEnabledBy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218175 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optc-gen.awk')
-rw-r--r-- | gcc/optc-gen.awk | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index ecb225c163a..8868510657f 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -38,8 +38,16 @@ for (i = 0; i < n_langs; i++) { for (i = 0; i < n_opts; i++) { enabledby_arg = opt_args("EnabledBy", flags[i]); if (enabledby_arg != "") { - n_enabledby_names = split(enabledby_arg, enabledby_names, " && "); - if (n_enabledby_names > 2) { + logical_and = index(enabledby_arg, " && "); + if (logical_and != 0) { + # EnabledBy(arg1 && arg2) + split_sep = " && "; + } else { + # EnabledBy(arg) or EnabledBy(arg1 || arg2 || arg3) + split_sep = " \\|\\| "; + } + n_enabledby_names = split(enabledby_arg, enabledby_names, split_sep); + if (logical_and != 0 && n_enabledby_names > 2) { print "#error EnabledBy (Wfoo && Wbar && Wbaz) not currently supported" } for (j = 1; j <= n_enabledby_names; j++) { @@ -49,7 +57,7 @@ for (i = 0; i < n_opts; i++) { print "#error Enabledby: " enabledby_name } else { condition = ""; - if (n_enabledby_names == 2) { + if (logical_and != 0) { opt_var_name_1 = search_var_name(enabledby_names[1], opt_numbers, opts, flags, n_opts); opt_var_name_2 = search_var_name(enabledby_names[2], opt_numbers, opts, flags, n_opts); if (opt_var_name_1 == "") { |