summaryrefslogtreecommitdiff
path: root/gcc/opt-functions.awk
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-14 13:30:32 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-14 13:30:32 +0000
commitd3b7ee7cc788bd22aa3682d2babfbdd1db0b88ac (patch)
treefc0863eee154e2d3cc964810f8b77726fbaa7a94 /gcc/opt-functions.awk
parentc8010b803d34fa7e096747067e33c650b36ecc06 (diff)
downloadgcc-d3b7ee7cc788bd22aa3682d2babfbdd1db0b88ac.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187462 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opt-functions.awk')
-rw-r--r--gcc/opt-functions.awk11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index 1f582fb4a16..8e098c28c2c 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -30,7 +30,9 @@ BEGIN {
# Return nonzero if FLAGS contains a flag matching REGEX.
function flag_set_p(regex, flags)
{
- return (" " flags " ") ~ (" " regex " ")
+ # Ignore the arguments of flags with arguments.
+ gsub ("\\([^)]+\\)", "", flags);
+ return (" " flags " ") ~ (" " regex " ")
}
# Return STRING if FLAGS contains a flag matching regexp REGEX,
@@ -287,3 +289,10 @@ function opt_enum(name)
{
return "OPT_" opt_sanitized_name(name)
}
+
+# Given the language called NAME return a sanitized version of its name.
+function lang_sanitized_name(name)
+{
+ gsub( "[^" alnum "_]", "X", name )
+ return name
+}