aboutsummaryrefslogtreecommitdiff
path: root/gcc/opt-functions.awk
diff options
context:
space:
mode:
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 1f582fb..8e098c2 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
+}