aboutsummaryrefslogtreecommitdiff
path: root/gcc/opth-gen.awk
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2012-05-14 13:30:32 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2012-05-14 13:30:32 +0000
commitf2bc201f53e2b8b9b9d072b41c5099ee825686f4 (patch)
treefc0863eee154e2d3cc964810f8b77726fbaa7a94 /gcc/opth-gen.awk
parente384e6b59c074ac936f0f3212ca33fe40f3d82f5 (diff)
downloadgcc-f2bc201f53e2b8b9b9d072b41c5099ee825686f4.zip
gcc-f2bc201f53e2b8b9b9d072b41c5099ee825686f4.tar.gz
gcc-f2bc201f53e2b8b9b9d072b41c5099ee825686f4.tar.bz2
re PR c/53063 (encode group options in the .opt files)
2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 53063 c-family/ * c.opt (Wc++0X-compat,Wdelete-non-virtual-dtor,Wjump-misses-init, Wreorder): Use LangEnabledBy. * c-opts.c (c_common_handle_option): Do not enable them explicitly. Call lang-specific generated functions. (c_common_post_options): Do not set them here. gcc/ * doc/options.texi: (LangEnabledBy): Document it. * optc-gen.awk: Handle LangEnabledBy. * opth-gen.awk: Generate declaration for lang-specific functions. * opt-read.awk: Record lang numbers. * opt-functions.awk (flag_set_p): Ignore the arguments of flags. (lang_sanitized_name): New. ada/ * gcc-interface/misc.c: Include opts.h and options.h before tm.h. (gnat_handle_option): Call lang-specific generated function. fortran/ * options.c (gfc_handle_option): Call lang-specific generated function. From-SVN: r187462
Diffstat (limited to 'gcc/opth-gen.awk')
-rw-r--r--gcc/opth-gen.awk14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index 8257587..8e583f0 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -305,6 +305,17 @@ print " unsigned int lang_mask, int kind, "
print " location_t loc, "
print " const struct cl_option_handlers *handlers, "
print " diagnostic_context *dc); "
+for (i = 0; i < n_langs; i++) {
+ lang_name = lang_sanitized_name(langs[i]);
+ print "bool "
+ print lang_name "_handle_option_auto (struct gcc_options *opts, "
+ print " struct gcc_options *opts_set, "
+ print " size_t scode, const char *arg, int value, "
+ print " unsigned int lang_mask, int kind, "
+ print " location_t loc, "
+ print " const struct cl_option_handlers *handlers, "
+ print " diagnostic_context *dc); "
+}
print "#endif";
print "#endif";
print "";
@@ -401,8 +412,7 @@ for (i = 0; i < n_opts; i++) {
print ""
for (i = 0; i < n_langs; i++) {
- macros[i] = "CL_" langs[i]
- gsub( "[^" alnum "_]", "X", macros[i] )
+ macros[i] = "CL_" lang_sanitized_name(langs[i])
s = substr(" ", length (macros[i]))
print "#define " macros[i] s " (1U << " i ")"
}