diff options
Diffstat (limited to 'gcc/optc-gen.awk')
-rw-r--r-- | gcc/optc-gen.awk | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index d0a07f8a5d3..4376d72dedd 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -201,6 +201,36 @@ for (i = 0; i < n_opts; i++) { else missing_arg_error = quote missing_arg_error quote + alias_arg = opt_args("Alias", flags[i]) + if (alias_arg == "") { + alias_data = "NULL, NULL, N_OPTS" + } else { + alias_opt = nth_arg(0, alias_arg) + alias_posarg = nth_arg(1, alias_arg) + alias_negarg = nth_arg(2, alias_arg) + + if (var_ref(opts[i], flags[i]) != "0") + print "#error Alias setting variable" + + if (alias_posarg != "" && alias_negarg == "") { + if (!flag_set_p("RejectNegative", flags[i]) \ + && opts[i] ~ "^[Wfm]") + print "#error Alias with single argument " \ + "allowing negative form" + } + + alias_opt = opt_enum(alias_opt) + if (alias_posarg == "") + alias_posarg = "NULL" + else + alias_posarg = quote alias_posarg quote + if (alias_negarg == "") + alias_negarg = "NULL" + else + alias_negarg = quote alias_negarg quote + alias_data = alias_posarg ", " alias_negarg ", " alias_opt + } + neg = opt_args("Negative", flags[i]); if (neg != "") idx = indices[neg] @@ -216,9 +246,9 @@ for (i = 0; i < n_opts; i++) { } # Split the printf after %u to work around an ia64-hp-hpux11.23 # awk bug. - printf(" { %c-%s%c,\n %s,\n %s,\n %s, %u,", + printf(" { %c-%s%c,\n %s,\n %s,\n %s, %s, %u,", quote, opts[i], quote, hlp, missing_arg_error, - back_chain[i], len) + alias_data, back_chain[i], len) printf(" %d,\n", idx) condition = opt_args("Condition", flags[i]) cl_flags = switch_flags(flags[i]) |