diff options
Diffstat (limited to 'gcc/opt-functions.awk')
-rw-r--r-- | gcc/opt-functions.awk | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index a21f29d4b12..00e6d016130 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -18,6 +18,14 @@ # Some common subroutines for use by opt[ch]-gen.awk. +# APPLE LOCAL begin optimization pragmas 3124235/3420242 +# Return nonzero if FLAGS contains a flag matching REGEX. +function flag_set_p(regex, flags) +{ + return (" " flags " ") ~ (" " regex " ") +} +# APPLE LOCAL end optimization pragmas 3124235/3420242 + function switch_flags (flags) { flags = " " flags " " @@ -37,6 +45,10 @@ function switch_flags (flags) if (flags ~ " UInteger ") result = result " | CL_UINTEGER" if (flags ~ " Undocumented ") result = result " | CL_UNDOCUMENTED" if (flags ~ " Report ") result = result " | CL_REPORT" +# APPLE LOCAL begin optimization pragmas 3124235/3420242 + if (flags ~ " VarUint ") result = result " | CL_VARUINT" + if (flags ~ " PerFunc ") result = result " | CL_PERFUNC" +# APPLE LOCAL end optimization pragmas 3124235/3420242 sub( "^0 \\| ", "", result ) return result } @@ -69,8 +81,35 @@ function var_set(flags) function var_ref(flags) { name = var_name(flags) +# APPLE LOCAL begin optimization pragmas 3124235/3420242 + if (flags ~ "PerFunc") { + if (flags ~ "VarUint") { + return "&cl_pf_opts.fld_" name + } else { + return "0" + } + } +# APPLE LOCAL end optimization pragmas 3124235/3420242 if (name == "") return "0" else return "&" name } +# APPLE LOCAL begin optimization pragmas 3124235/3420242 +# Given that an option has flags FLAGS, return an initializer for the +# "access_flag" field of its cl_options[] entry. This applies only to +# PerFunc VarUint things (bitfields) at the moment. +function access_ref(flags) +{ + name = var_name(flags) + if (flags !~ "PerFunc") { + return "0" + } + if (flags ~ "VarUint") { + return "0" + } + if (name != "") + return "cl_opt_access_func_" name + return "0" +} +# APPLE LOCAL end optimization pragmas 3124235/3420242 |