diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 880ac776d8a..d63407c5c88 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -275,6 +275,25 @@ for (i = 0; i < n_opts; i++) { indices[opts[i]] = j; } j++; + if (help[i] != "" && flag_set_p("Driver", flags[i]) \ + && !flag_set_p("Common", flags[i])) { + nflags = split(switch_flags(flags[i]), flag_array, " | ") + help_warn = 1 + for (j = 0; j < nflags; j++) { + if (flag_array[j] != "" \ + && flag_array[j] != "|" \ + && flag_array[j] != "CL_DRIVER" \ + && flag_array[j] != "CL_SEPARATE" \ + && flag_array[j] != "CL_JOINED" \ + && flag_array[j] != "CL_UNDOCUMENTED") { + help_warn = 0 + } + } + if (help_warn != 0) + print "#warning Help text provided for Driver only " \ + "option '" opts[i] "' move it to gcc.c's " \ + "display_help: " help[i] + } } optindex = 0