Make-lang.in, [...]: Update copyright years.
* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c,
basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h,
collect2.h, config/alpha/alpha.c, config/alpha/alpha.md,
config/alpha/predicates.md, config/arm/arm.md,
config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml,
config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c,
config/darwin9.h, config/darwin.c, config/darwin.h,
config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h,
config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c,
config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c,
config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c,
config/mips/mips.md, config/mn10300/mn10300.c,
config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md,
config/rs6000/aix.h, config/rs6000/dfp.md,
config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c,
config/rs6000/vector.md, config/rtems.h, config/rx/rx.md,
config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h,
config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md,
config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c,
config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in,
c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c,
diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi,
doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi,
doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c,
fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h,
gensupport.c, gimple.h, gimple-iterator.c, graphite.c,
graphite-clast-to-gimple.c, graphite-clast-to-gimple.h,
graphite-dependences.c, graphite-poly.c, graphite-poly.h,
graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c,
graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c,
intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h,
ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c,
ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c,
loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c,
objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk,
opt-functions.awk, opth-gen.awk, params.def, passes.c,
postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h,
rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h,
store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c,
tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h,
tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c,
tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c,
tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c,
tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c,
unwind-dw2-fde-darwin.c, varpool.c: Update copyright years.
From-SVN: r157950
2010-04-02 21:54:46 +02:00
|
|
|
# Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
|
|
|
|
# Free Software Foundation, Inc.
|
2004-06-18 03:59:45 +02:00
|
|
|
# Contributed by Kelley Cook, June 2004.
|
|
|
|
# Original code from Neil Booth, May 2003.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License as published by the
|
2007-07-26 10:37:01 +02:00
|
|
|
# Free Software Foundation; either version 3, or (at your option) any
|
2004-06-18 03:59:45 +02:00
|
|
|
# later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-07-26 10:37:01 +02:00
|
|
|
# along with this program; see the file COPYING3. If not see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
# This Awk script reads in the option records generated from
|
2008-05-11 21:43:00 +02:00
|
|
|
# opt-gather.awk, combines the flags of duplicate options and generates a
|
2004-06-18 03:59:45 +02:00
|
|
|
# C file.
|
|
|
|
#
|
|
|
|
# This program uses functions from opt-functions.awk
|
|
|
|
#
|
|
|
|
# Usage: awk -f opt-functions.awk -f optc-gen.awk \
|
|
|
|
# [-v header_name=header.h] < inputfile > options.c
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
n_opts = 0
|
|
|
|
n_langs = 0
|
2008-07-23 12:28:06 +02:00
|
|
|
n_target_save = 0
|
2004-06-18 03:59:45 +02:00
|
|
|
quote = "\042"
|
|
|
|
comma = ","
|
|
|
|
FS=SUBSEP
|
|
|
|
# Default the name of header created from opth-gen.awk to options.h
|
|
|
|
if (header_name == "") header_name="options.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Collect the text and flags of each option into an array
|
|
|
|
{
|
|
|
|
if ($1 == "Language") {
|
|
|
|
langs[n_langs] = $2
|
|
|
|
n_langs++;
|
|
|
|
}
|
2008-07-23 12:28:06 +02:00
|
|
|
else if ($1 == "TargetSave") {
|
|
|
|
# Make sure the declarations are put in source order
|
|
|
|
target_save_decl[n_target_save] = $2
|
|
|
|
n_target_save++
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
else {
|
optc-gen.awk: Handle stand-alone Mask records.
* optc-gen.awk: Handle stand-alone Mask records.
* opth-gen.awk: Likewise.
* doc/options.texi (Option file format): Document them.
* config.gcc (sparc-*-netbsdelf*, sparc-*-linux*, sparc64-*-freebsd*,
sparc64-*-linux*, sparc64-*-netbsd*): Add long-double-switch.opt.
(sparc64-*-openbsd*, sparc64-*-elf*): Add little-endian.opt.
* config/sparc/sparc.h (MASK_FPU, MASK_UNALIGNED_DOUBLES,
MASK_V8, MASK_SPARCLITE, MASK_SPARCLET, MASK_V9,
MASK_DEPRECATED_V8_INSNS, MASK_IMPURE_TEXT, MASK_APP_REGS,
MASK_HARD_QUAD, MASK_LITTLE_ENDIAN, MASK_PTR64, MASK_64BIT,
MASK_STACK_BIAS, MASK_FPU_SET, MASK_VIS, MASK_V8PLUS,
MASK_FASTER_STRUCTS, MASK_LONG_DOUBLE_128): Delete.
(TARGET_FPU, TARGET_UNALIGNED_DOUBLES, TARGET_V8, TARGET_SPARCLITE,
TARGET_SPARCLET, TARGET_V9, TARGET_DEPRECATED_V8_INSNS,
TARGET_IMPURE_TEXT, TARGET_APP_REGS, MASK_HARD_QUAD,
TARGET_LITTLE_ENDIAN, TARGET_PTR64, TARGET_64BIT, MASK_STACK_BIAS,
TARGET_FPU_SET, TARGET_VIS, TARGET_V8PLUS, TARGET_FASTER_STRUCTS,
TARGET_LONG_DOUBLE_128): Likewise.
(TARGET_SWITCHES, SUBTARGET_SWITCHES): Likewise.
(TARGET_OPTIONS, SUBTARGET_OPTIONS): Likewise.
* config/sparc/freebsd.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/linux.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/linux64.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/netbsd-elf.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/sp64-elf.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/sparc.c (fpu_option_set): New global.
(sparc_handle_option): New function.
(sparc_override_options): Test fpu_option_set.
(TARGET_DEFAULT_TARGET_FLAGS): Set to TARGET_DEFAULT.
(TARGET_HANDLE_OPTION): Set to sparc_handle_option.
* config/sparc/sparc.opt: New file.
* config/sparc/little-endian.opt: Likewise.
* config/sparc/long-double-switch.opt: Likewise.
From-SVN: r98078
2005-04-13 10:47:23 +02:00
|
|
|
name = opt_args("Mask", $1)
|
|
|
|
if (name == "") {
|
|
|
|
opts[n_opts] = $1
|
|
|
|
flags[n_opts] = $2
|
|
|
|
help[n_opts] = $3
|
2009-03-01 12:26:06 +01:00
|
|
|
for (i = 4; i <= NF; i++)
|
|
|
|
help[n_opts] = help[n_opts] " " $i
|
optc-gen.awk: Handle stand-alone Mask records.
* optc-gen.awk: Handle stand-alone Mask records.
* opth-gen.awk: Likewise.
* doc/options.texi (Option file format): Document them.
* config.gcc (sparc-*-netbsdelf*, sparc-*-linux*, sparc64-*-freebsd*,
sparc64-*-linux*, sparc64-*-netbsd*): Add long-double-switch.opt.
(sparc64-*-openbsd*, sparc64-*-elf*): Add little-endian.opt.
* config/sparc/sparc.h (MASK_FPU, MASK_UNALIGNED_DOUBLES,
MASK_V8, MASK_SPARCLITE, MASK_SPARCLET, MASK_V9,
MASK_DEPRECATED_V8_INSNS, MASK_IMPURE_TEXT, MASK_APP_REGS,
MASK_HARD_QUAD, MASK_LITTLE_ENDIAN, MASK_PTR64, MASK_64BIT,
MASK_STACK_BIAS, MASK_FPU_SET, MASK_VIS, MASK_V8PLUS,
MASK_FASTER_STRUCTS, MASK_LONG_DOUBLE_128): Delete.
(TARGET_FPU, TARGET_UNALIGNED_DOUBLES, TARGET_V8, TARGET_SPARCLITE,
TARGET_SPARCLET, TARGET_V9, TARGET_DEPRECATED_V8_INSNS,
TARGET_IMPURE_TEXT, TARGET_APP_REGS, MASK_HARD_QUAD,
TARGET_LITTLE_ENDIAN, TARGET_PTR64, TARGET_64BIT, MASK_STACK_BIAS,
TARGET_FPU_SET, TARGET_VIS, TARGET_V8PLUS, TARGET_FASTER_STRUCTS,
TARGET_LONG_DOUBLE_128): Likewise.
(TARGET_SWITCHES, SUBTARGET_SWITCHES): Likewise.
(TARGET_OPTIONS, SUBTARGET_OPTIONS): Likewise.
* config/sparc/freebsd.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/linux.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/linux64.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/netbsd-elf.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/sp64-elf.h (SUBTARGET_SWITCHES): Likewise.
* config/sparc/sparc.c (fpu_option_set): New global.
(sparc_handle_option): New function.
(sparc_override_options): Test fpu_option_set.
(TARGET_DEFAULT_TARGET_FLAGS): Set to TARGET_DEFAULT.
(TARGET_HANDLE_OPTION): Set to sparc_handle_option.
* config/sparc/sparc.opt: New file.
* config/sparc/little-endian.opt: Likewise.
* config/sparc/long-double-switch.opt: Likewise.
From-SVN: r98078
2005-04-13 10:47:23 +02:00
|
|
|
n_opts++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Dump that array of options into a C file.
|
|
|
|
END {
|
2008-02-07 21:40:19 +01:00
|
|
|
print "/* This file is auto-generated by optc-gen.awk. */"
|
2004-06-18 03:59:45 +02:00
|
|
|
print ""
|
2005-05-16 14:30:06 +02:00
|
|
|
n_headers = split(header_name, headers, " ")
|
|
|
|
for (i = 1; i <= n_headers; i++)
|
|
|
|
print "#include " quote headers[i] quote
|
2004-06-18 03:59:45 +02:00
|
|
|
print "#include " quote "opts.h" quote
|
2005-05-16 20:14:03 +02:00
|
|
|
print "#include " quote "intl.h" quote
|
2004-06-18 03:59:45 +02:00
|
|
|
print ""
|
2006-05-17 07:06:52 +02:00
|
|
|
print "#ifdef GCC_DRIVER"
|
2006-05-16 16:27:18 +02:00
|
|
|
print "int target_flags;"
|
2010-07-27 23:23:53 +02:00
|
|
|
print "int target_flags_explicit;"
|
2008-07-23 12:28:06 +02:00
|
|
|
print "#else"
|
|
|
|
print "#include " quote "flags.h" quote
|
|
|
|
print "#include " quote "target.h" quote
|
2006-05-17 07:06:52 +02:00
|
|
|
print "#endif /* GCC_DRIVER */"
|
2006-05-16 16:27:18 +02:00
|
|
|
print ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2008-07-23 12:28:06 +02:00
|
|
|
have_save = 0;
|
2004-06-18 03:59:45 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
2008-07-23 12:28:06 +02:00
|
|
|
if (flag_set_p("Save", flags[i]))
|
|
|
|
have_save = 1;
|
|
|
|
|
2004-06-18 03:59:45 +02:00
|
|
|
name = var_name(flags[i]);
|
|
|
|
if (name == "")
|
|
|
|
continue;
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
if (flag_set_p("VarExists", flags[i])) {
|
|
|
|
# Need it for the gcc driver.
|
|
|
|
if (name in var_seen)
|
|
|
|
continue;
|
|
|
|
init = ""
|
2006-05-17 07:06:52 +02:00
|
|
|
gcc_driver = 1
|
2006-05-16 16:27:18 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
init = opt_args("Init", flags[i])
|
|
|
|
if (init != "")
|
|
|
|
init = " = " init;
|
|
|
|
else if (name in var_seen)
|
|
|
|
continue;
|
2006-05-17 07:06:52 +02:00
|
|
|
gcc_driver = 0
|
2006-05-16 16:27:18 +02:00
|
|
|
}
|
2005-03-30 08:24:35 +02:00
|
|
|
|
2006-05-17 07:06:52 +02:00
|
|
|
if (gcc_driver == 1)
|
|
|
|
print "#ifdef GCC_DRIVER"
|
opt-functions.awk (var_type): New function.
* opt-functions.awk (var_type): New function.
(var_set): Use CLVC_STRING if var_type returns "const char *".
* opth-gen.awk: Use var_type to find out the types of variables.
Don't print comments above each "extern" definition.
* optc-gen.awk: Use var_type in the same way.
* opts.h (cl_var_cond): Rename to...
(cl_var_type): ...this. Add CLVC_STRING.
(cl_option): Make "flag_var" a "void *" pointer. Replace "var_cond"
with "var_type".
* opts.c (handle_option, option_enabled): Update after above name
change. Cast flag_var before using it. Handle CLVC_STRING.
* config/alpha/alpha.h (alpha_tls_size): Delete.
* config/alpha/alpha.c (alpha_tls_size, alpha_cpu_string)
(alpha_tune_string, alpha_tp_string, alpha_fprm_string)
(alpha_fptm_string, alpha_mlat_string): Delete.
(alpha_handle_option): Don't set the above variables here. Use the
integer argument to check the validity of -mtls-size=.
* config/alpha/alpha.opt (mcpu=, mtune=, mfp-rounding-mode=)
(mfp-trap-mode=, mtrap-precision=, mmemory-latency=): Add Var()s.
(mtls-size=): Likewise. Convert to a UInteger and initialize the
variable to 32.
* config/arc/arc.c (arc_cpu_string, arc_text_string)
(arc_data_string, arc_rodata_string): Delete.
(arc_handle_option): Don't set the above variables here.
* config/arc/arc.opt (mcpu=, mtext=, mdata=, mrodata=): Add Var()s
and initialize them.
* config/arm/arm.c (target_fpu_name, target_fpe_name)
(target_float_abi_name, target_abi_name, structure_size_string)
(arm_pic_register_string): Delete.
(arm_handle_option): Don't set the above variables here, except
in the handling of -mhard-float and -msoft-float.
* config/arm/arm.opt (mabi=, mfloat-abi=, mfp=, mfpe=, mfpu=)
(mpic-register=, mstructure-size-boundary=): Add Var()s.
* config/avr/avr.c (avr_init_stack, avr_mcu_name, TARGET_HANDLE_OPTION)
(avr_handle_option): Delete.
* config/avr/avr.opt (mmcu=, minit-stack=): Add Var()s and initialize
them.
* config/bfin/bfin.c (bfin_library_id): Delete.
(bfin_handle_option): Don't set it.
* config/bfin/bfin.opt (mshared-library-id=): Add Var().
* config/c4x/c4x.h (c4x_rpts_cycles): Delete.
* config/c4x/c4x.c (c4x_rpts_cycles): Delete.
(c4x_handle_option): Don't set c4x_rpts_cycles here.
* config/c4x/c4x.opt (mrpts=): Add Var().
* config/cris/aout.h (CRIS_SUBTARGET_HANDLE_OPTION): Don't set
cris_elinux_stacksize_str here.
* config/cris/aout.opt (melinux-stacksize=): Add Var().
* config/cris/cris.h (cris_max_stackframe_str, cris_cpu_str)
(cris_tune_str, cris_elinux_stacksize_str): Delete.
* config/cris/cris.c (cris_max_stackframe_str, cris_cpu_str)
(cris_tune_str, cris_elinux_stacksize_str): Delete.
(cris_handle_option): Don't set the above variables here.
* config/cris/cris.opt (mcpu=, march=, mtune=, mmax-stackframe=)
(max-stackframe=): Add Var()s.
* config/i386/i386.h (ix86_tune_string, ix86_arch_string): Delete.
* config/i386/i386.c (ix86_cmodel_string, ix86_asm_string)
(ix86_tls_dialect_string, ix86_tune_string, ix86_arch_string)
(ix86_fpmath_string, ix86_regparm_string, ix86_align_loops_string)
(ix86_align_jumps_string, ix86_preferred_stack_boundary_string)
(ix86_branch_cost_string, ix86_align_funcs_string): Delete.
(ix86_handle_option): Don't set the above variables here.
* config/i386/i386.opt (malign-functions=, malign-jumps=)
(malign-loops=, march=, masm=, mbranch-cost=, mcmodel=, mfpmath=)
(mpreferred-stack-boundary=, mregparm=, mtls-dialect=, mtune=): Add
Var()s.
* config/ia64/ia64.h (ia64_tls_size): Delete.
* config/ia64/ia64.c (ia64_tls_size): Delete.
(ia64_handle_option): Treat -mtls-size= as a UInteger option,
reading the integer argument from the "value" parameter. Don't
set ia64_tls_size here.
* config/ia64/ia64.opt (mtls-size=): Turn into a UInteger option.
Add Var() and Init().
* config/m32r/m32r.h (m32r_cache_flush_func): Delete.
(m32r_cache_flush_trap): Delete.
* config/m32r/m32r.c (m32r_cache_flush_func): Delete.
(m32r_cache_flush_trap): Delete.
(m32r_handle_option): Don't set the above variables when handling
-mflush-func= and -mflush-trap=.
* config/m32r/m32r.opt (-mflush-func=, -mflush-trap=): Add Var()s
and Init()s.
* config/mips/mips.h (mips_cache_flush_func): Delete.
* config/mips/mips.c (mips_arch_string, mips_tune_string)
(mips_cache_flush_func): Delete.
(mips_handle_option): Don't set the above variables when handling
-march=, -mtune= and -mflush-func=.
* config/mips/mips.opt (march=, mflush-func=, mtune=): Add Var()s.
* config/s390/s390.c (s390_arch_string): Delete.
(s390_handle_option): Don't set it here.
* config/s390/s390.opt (march=): Add Var().
* config/sparc/sparc.h (sparc_cmodel_string): Delete.
* config/sparc/sparc.c (sparc_cmodel_string): Delete.
(sparc_handle_option): Don't set it here.
* config/sparc/sparc.opt (mcmodel=): Add Var().
From-SVN: r100185
2005-05-26 07:28:04 +02:00
|
|
|
print "/* Set by -" opts[i] "."
|
|
|
|
print " " help[i] " */"
|
|
|
|
print var_type(flags[i]) name init ";"
|
2006-05-17 07:06:52 +02:00
|
|
|
if (gcc_driver == 1)
|
|
|
|
print "#endif /* GCC_DRIVER */"
|
opt-functions.awk (var_type): New function.
* opt-functions.awk (var_type): New function.
(var_set): Use CLVC_STRING if var_type returns "const char *".
* opth-gen.awk: Use var_type to find out the types of variables.
Don't print comments above each "extern" definition.
* optc-gen.awk: Use var_type in the same way.
* opts.h (cl_var_cond): Rename to...
(cl_var_type): ...this. Add CLVC_STRING.
(cl_option): Make "flag_var" a "void *" pointer. Replace "var_cond"
with "var_type".
* opts.c (handle_option, option_enabled): Update after above name
change. Cast flag_var before using it. Handle CLVC_STRING.
* config/alpha/alpha.h (alpha_tls_size): Delete.
* config/alpha/alpha.c (alpha_tls_size, alpha_cpu_string)
(alpha_tune_string, alpha_tp_string, alpha_fprm_string)
(alpha_fptm_string, alpha_mlat_string): Delete.
(alpha_handle_option): Don't set the above variables here. Use the
integer argument to check the validity of -mtls-size=.
* config/alpha/alpha.opt (mcpu=, mtune=, mfp-rounding-mode=)
(mfp-trap-mode=, mtrap-precision=, mmemory-latency=): Add Var()s.
(mtls-size=): Likewise. Convert to a UInteger and initialize the
variable to 32.
* config/arc/arc.c (arc_cpu_string, arc_text_string)
(arc_data_string, arc_rodata_string): Delete.
(arc_handle_option): Don't set the above variables here.
* config/arc/arc.opt (mcpu=, mtext=, mdata=, mrodata=): Add Var()s
and initialize them.
* config/arm/arm.c (target_fpu_name, target_fpe_name)
(target_float_abi_name, target_abi_name, structure_size_string)
(arm_pic_register_string): Delete.
(arm_handle_option): Don't set the above variables here, except
in the handling of -mhard-float and -msoft-float.
* config/arm/arm.opt (mabi=, mfloat-abi=, mfp=, mfpe=, mfpu=)
(mpic-register=, mstructure-size-boundary=): Add Var()s.
* config/avr/avr.c (avr_init_stack, avr_mcu_name, TARGET_HANDLE_OPTION)
(avr_handle_option): Delete.
* config/avr/avr.opt (mmcu=, minit-stack=): Add Var()s and initialize
them.
* config/bfin/bfin.c (bfin_library_id): Delete.
(bfin_handle_option): Don't set it.
* config/bfin/bfin.opt (mshared-library-id=): Add Var().
* config/c4x/c4x.h (c4x_rpts_cycles): Delete.
* config/c4x/c4x.c (c4x_rpts_cycles): Delete.
(c4x_handle_option): Don't set c4x_rpts_cycles here.
* config/c4x/c4x.opt (mrpts=): Add Var().
* config/cris/aout.h (CRIS_SUBTARGET_HANDLE_OPTION): Don't set
cris_elinux_stacksize_str here.
* config/cris/aout.opt (melinux-stacksize=): Add Var().
* config/cris/cris.h (cris_max_stackframe_str, cris_cpu_str)
(cris_tune_str, cris_elinux_stacksize_str): Delete.
* config/cris/cris.c (cris_max_stackframe_str, cris_cpu_str)
(cris_tune_str, cris_elinux_stacksize_str): Delete.
(cris_handle_option): Don't set the above variables here.
* config/cris/cris.opt (mcpu=, march=, mtune=, mmax-stackframe=)
(max-stackframe=): Add Var()s.
* config/i386/i386.h (ix86_tune_string, ix86_arch_string): Delete.
* config/i386/i386.c (ix86_cmodel_string, ix86_asm_string)
(ix86_tls_dialect_string, ix86_tune_string, ix86_arch_string)
(ix86_fpmath_string, ix86_regparm_string, ix86_align_loops_string)
(ix86_align_jumps_string, ix86_preferred_stack_boundary_string)
(ix86_branch_cost_string, ix86_align_funcs_string): Delete.
(ix86_handle_option): Don't set the above variables here.
* config/i386/i386.opt (malign-functions=, malign-jumps=)
(malign-loops=, march=, masm=, mbranch-cost=, mcmodel=, mfpmath=)
(mpreferred-stack-boundary=, mregparm=, mtls-dialect=, mtune=): Add
Var()s.
* config/ia64/ia64.h (ia64_tls_size): Delete.
* config/ia64/ia64.c (ia64_tls_size): Delete.
(ia64_handle_option): Treat -mtls-size= as a UInteger option,
reading the integer argument from the "value" parameter. Don't
set ia64_tls_size here.
* config/ia64/ia64.opt (mtls-size=): Turn into a UInteger option.
Add Var() and Init().
* config/m32r/m32r.h (m32r_cache_flush_func): Delete.
(m32r_cache_flush_trap): Delete.
* config/m32r/m32r.c (m32r_cache_flush_func): Delete.
(m32r_cache_flush_trap): Delete.
(m32r_handle_option): Don't set the above variables when handling
-mflush-func= and -mflush-trap=.
* config/m32r/m32r.opt (-mflush-func=, -mflush-trap=): Add Var()s
and Init()s.
* config/mips/mips.h (mips_cache_flush_func): Delete.
* config/mips/mips.c (mips_arch_string, mips_tune_string)
(mips_cache_flush_func): Delete.
(mips_handle_option): Don't set the above variables when handling
-march=, -mtune= and -mflush-func=.
* config/mips/mips.opt (march=, mflush-func=, mtune=): Add Var()s.
* config/s390/s390.c (s390_arch_string): Delete.
(s390_handle_option): Don't set it here.
* config/s390/s390.opt (march=): Add Var().
* config/sparc/sparc.h (sparc_cmodel_string): Delete.
* config/sparc/sparc.c (sparc_cmodel_string): Delete.
(sparc_handle_option): Don't set it here.
* config/sparc/sparc.opt (mcmodel=): Add Var().
From-SVN: r100185
2005-05-26 07:28:04 +02:00
|
|
|
print ""
|
2005-04-28 22:52:12 +02:00
|
|
|
|
|
|
|
var_seen[name] = 1;
|
2005-03-30 08:24:35 +02:00
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-06-14 16:37:49 +02:00
|
|
|
print ""
|
|
|
|
print "/* Local state variables. */"
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = static_var(opts[i], flags[i]);
|
|
|
|
if (name != "")
|
|
|
|
print "static " var_type(flags[i]) name ";"
|
|
|
|
}
|
|
|
|
print ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
print "const char * const lang_names[] =\n{"
|
|
|
|
for (i = 0; i < n_langs; i++) {
|
|
|
|
macros[i] = "CL_" langs[i]
|
|
|
|
gsub( "[^A-Za-z0-9_]", "X", macros[i] )
|
|
|
|
s = substr(" ", length (macros[i]))
|
|
|
|
print " " quote langs[i] quote ","
|
|
|
|
}
|
|
|
|
|
|
|
|
print " 0\n};\n"
|
|
|
|
print "const unsigned int cl_options_count = N_OPTS;\n"
|
2007-02-12 17:25:14 +01:00
|
|
|
print "const unsigned int cl_lang_count = " n_langs ";\n"
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
print "const struct cl_option cl_options[] =\n{"
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
j = 0
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
2004-06-18 03:59:45 +02:00
|
|
|
back_chain[i] = "N_OPTS";
|
2006-05-16 16:27:18 +02:00
|
|
|
indices[opts[i]] = j;
|
|
|
|
# Combine the flags of identical switches. Switches
|
|
|
|
# appear many times if they are handled by many front
|
|
|
|
# ends, for example.
|
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
flags[i + 1] = flags[i] " " flags[i + 1];
|
2009-03-01 13:20:33 +01:00
|
|
|
if (help[i + 1] == "")
|
|
|
|
help[i + 1] = help[i]
|
2009-03-30 07:55:57 +02:00
|
|
|
else if (help[i] != "" && help[i + 1] != help[i])
|
|
|
|
print "warning: multiple different help strings for " \
|
|
|
|
opts[i] ":\n\t" help[i] "\n\t" help[i + 1] \
|
|
|
|
| "cat 1>&2"
|
2006-05-16 16:27:18 +02:00
|
|
|
i++;
|
|
|
|
back_chain[i] = "N_OPTS";
|
|
|
|
indices[opts[i]] = j;
|
|
|
|
}
|
|
|
|
j++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
2009-03-01 13:20:33 +01:00
|
|
|
# With identical flags, pick only the last one. The
|
|
|
|
# earlier loop ensured that it has all flags merged,
|
|
|
|
# and a nonempty help text if one of the texts was nonempty.
|
2005-05-15 10:10:10 +02:00
|
|
|
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
|
|
|
|
i++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
len = length (opts[i]);
|
2010-04-13 16:27:22 +02:00
|
|
|
enum = opt_enum(opts[i])
|
2005-05-15 10:10:10 +02:00
|
|
|
|
|
|
|
# If this switch takes joined arguments, back-chain all
|
|
|
|
# subsequent switches to it for which it is a prefix. If
|
|
|
|
# a later switch S is a longer prefix of a switch T, T
|
|
|
|
# will be back-chained to S in a later iteration of this
|
|
|
|
# for() loop, which is what we want.
|
|
|
|
if (flag_set_p("Joined.*", flags[i])) {
|
|
|
|
for (j = i + 1; j < n_opts; j++) {
|
|
|
|
if (substr (opts[j], 1, len) != opts[i])
|
|
|
|
break;
|
|
|
|
back_chain[j] = enum;
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
2005-05-15 10:10:10 +02:00
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
s = substr(" ", length (opts[i]))
|
|
|
|
if (i + 1 == n_opts)
|
|
|
|
comma = ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2005-05-15 10:10:10 +02:00
|
|
|
if (help[i] == "")
|
|
|
|
hlp = "0"
|
|
|
|
else
|
|
|
|
hlp = quote help[i] quote;
|
2004-06-18 03:59:45 +02:00
|
|
|
|
common.opt (o): Add MissingArgError.
* common.opt (o): Add MissingArgError.
* doc/options.texi (MissingArgError): Document.
* hooks.c (hook_bool_constcharptr_size_t_false): Remove.
* hooks.h (hook_bool_constcharptr_size_t_false): Remove.
* langhooks-def.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
(LANG_HOOKS_INITIALIZER): Remove missing_argument hook
initializer.
* langhooks.h (struct lang_hooks): Remove missing_argument.
* optc-gen.awk: Handle MissingArgError and output new structure
field initializers.
* opts.c (read_cmdline_option): Use missing_argument_error field
instead of missing_argument langhook.
* opts.h (struct cl_option): Add missing_argument_error field.
* system.h (LANG_HOOKS_MISSING_ARGUMENT): Poison.
c-family:
* c-common.h (c_common_missing_argument): Remove.
* c-opts.c (c_common_missing_argument): Remove.
* c.opt (A, D, F, I, MD, MMD, MQ, MT, U, fconstant-string-class=,
idirafter, imacros, include, isysroot, isystem, iquote): Add
MissingArgError.
* c-objc-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
cp:
* cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
po:
* exgettext: Also extract MissingArgError texts from .opt files.
From-SVN: r162571
2010-07-27 16:43:31 +02:00
|
|
|
missing_arg_error = opt_args("MissingArgError", flags[i])
|
|
|
|
if (missing_arg_error == "")
|
|
|
|
missing_arg_error = "0"
|
|
|
|
else
|
|
|
|
missing_arg_error = quote missing_arg_error quote
|
|
|
|
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
alias_arg = opt_args("Alias", flags[i])
|
|
|
|
if (alias_arg == "") {
|
|
|
|
alias_data = "NULL, NULL, N_OPTS"
|
|
|
|
} else {
|
|
|
|
alias_opt = nth_arg(0, alias_arg)
|
|
|
|
alias_posarg = nth_arg(1, alias_arg)
|
|
|
|
alias_negarg = nth_arg(2, alias_arg)
|
|
|
|
|
|
|
|
if (var_ref(opts[i], flags[i]) != "0")
|
|
|
|
print "#error Alias setting variable"
|
|
|
|
|
|
|
|
if (alias_posarg != "" && alias_negarg == "") {
|
|
|
|
if (!flag_set_p("RejectNegative", flags[i]) \
|
|
|
|
&& opts[i] ~ "^[Wfm]")
|
|
|
|
print "#error Alias with single argument " \
|
|
|
|
"allowing negative form"
|
|
|
|
}
|
|
|
|
|
|
|
|
alias_opt = opt_enum(alias_opt)
|
|
|
|
if (alias_posarg == "")
|
|
|
|
alias_posarg = "NULL"
|
|
|
|
else
|
|
|
|
alias_posarg = quote alias_posarg quote
|
|
|
|
if (alias_negarg == "")
|
|
|
|
alias_negarg = "NULL"
|
|
|
|
else
|
|
|
|
alias_negarg = quote alias_negarg quote
|
|
|
|
alias_data = alias_posarg ", " alias_negarg ", " alias_opt
|
|
|
|
}
|
|
|
|
|
2006-05-16 16:27:18 +02:00
|
|
|
neg = opt_args("Negative", flags[i]);
|
|
|
|
if (neg != "")
|
|
|
|
idx = indices[neg]
|
|
|
|
else {
|
|
|
|
if (flag_set_p("RejectNegative", flags[i]))
|
|
|
|
idx = -1;
|
|
|
|
else {
|
|
|
|
if (opts[i] ~ "^[Wfm]")
|
|
|
|
idx = indices[opts[i]];
|
|
|
|
else
|
|
|
|
idx = -1;
|
|
|
|
}
|
|
|
|
}
|
2008-04-29 00:27:22 +02:00
|
|
|
# Split the printf after %u to work around an ia64-hp-hpux11.23
|
|
|
|
# awk bug.
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
printf(" { %c-%s%c,\n %s,\n %s,\n %s, %s, %u,",
|
common.opt (o): Add MissingArgError.
* common.opt (o): Add MissingArgError.
* doc/options.texi (MissingArgError): Document.
* hooks.c (hook_bool_constcharptr_size_t_false): Remove.
* hooks.h (hook_bool_constcharptr_size_t_false): Remove.
* langhooks-def.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
(LANG_HOOKS_INITIALIZER): Remove missing_argument hook
initializer.
* langhooks.h (struct lang_hooks): Remove missing_argument.
* optc-gen.awk: Handle MissingArgError and output new structure
field initializers.
* opts.c (read_cmdline_option): Use missing_argument_error field
instead of missing_argument langhook.
* opts.h (struct cl_option): Add missing_argument_error field.
* system.h (LANG_HOOKS_MISSING_ARGUMENT): Poison.
c-family:
* c-common.h (c_common_missing_argument): Remove.
* c-opts.c (c_common_missing_argument): Remove.
* c.opt (A, D, F, I, MD, MMD, MQ, MT, U, fconstant-string-class=,
idirafter, imacros, include, isysroot, isystem, iquote): Add
MissingArgError.
* c-objc-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
cp:
* cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
po:
* exgettext: Also extract MissingArgError texts from .opt files.
From-SVN: r162571
2010-07-27 16:43:31 +02:00
|
|
|
quote, opts[i], quote, hlp, missing_arg_error,
|
re PR driver/44076 (-MT <target> behaves different as -MT<target> (w/o space))
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
* opt-functions.awk (opt_sanitized_name): Don't handle
finline-limit=, Wlarger-than= and ftemplate-depth= specially.
* optc-gen.awk: Generate alias fields.
* opth-gen.awk: Explicitly give values for OPT_* enum constants.
Don't generate such constants for aliases.
* opts-common.c (generate_canonical_option): New.
(decode_cmdline_option): Handle aliases. Use
generate_canonical_option for known options instead of copying the
input option text.
* doc/options.texi (Alias): Document.
* common.opt (W, Wlarger-than-, aux-info=, finline-limit-,
fstack-check, specs): Mark as aliases.
* gcc.c (driver_handle_option): Canonicalize -L options to joined
arguments.
(driver_handle_option): Don't handle OPT_specs.
* opts.c (common_handle_option): Don't handle options marked as
aliases.
(enable_warning_as_error): Handle aliases.
* stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of
OPT_Wlarger_than_eq.
* tree-optimize.c (tree_rest_of_compilation): Use
OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq.
c-family:
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
aliases.
* c-common.c (option_codes): Use OPT_Wcomment instead of
OPT_Wcomments.
* c-opts.c (warning_as_error_callback, c_common_handle_option):
Don't handle options marked as aliases.
java:
* lang.opt (CLASSPATH, bootclasspath, classpath, encoding,
fCLASSPATH=): Mark as Java options and as aliases.
* jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*.
(lang_specific_driver): Don't handle options marked as aliases.
* lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_.
testsuite:
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
but using -Werror=comment.
* gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust
expected error messages.
From-SVN: r163770
2010-09-02 13:41:22 +02:00
|
|
|
alias_data, back_chain[i], len)
|
2008-04-29 00:27:22 +02:00
|
|
|
printf(" %d,\n", idx)
|
2005-05-16 14:30:06 +02:00
|
|
|
condition = opt_args("Condition", flags[i])
|
|
|
|
cl_flags = switch_flags(flags[i])
|
|
|
|
if (condition != "")
|
|
|
|
printf("#if %s\n" \
|
|
|
|
" %s,\n" \
|
|
|
|
"#else\n" \
|
|
|
|
" CL_DISABLED,\n" \
|
|
|
|
"#endif\n",
|
|
|
|
condition, cl_flags, cl_flags)
|
|
|
|
else
|
|
|
|
printf(" %s,\n", cl_flags)
|
2005-06-14 16:37:49 +02:00
|
|
|
printf(" %s, %s }%s\n", var_ref(opts[i], flags[i]),
|
|
|
|
var_set(flags[i]), comma)
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
print "};"
|
2008-07-23 12:28:06 +02:00
|
|
|
|
|
|
|
print "";
|
2008-07-23 21:03:40 +02:00
|
|
|
print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
|
2008-07-23 12:28:06 +02:00
|
|
|
print "";
|
|
|
|
print "/* Save optimization variables into a structure. */"
|
|
|
|
print "void";
|
|
|
|
print "cl_optimization_save (struct cl_optimization *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
n_opt_char = 2;
|
|
|
|
n_opt_short = 0;
|
|
|
|
n_opt_int = 0;
|
|
|
|
n_opt_other = 0;
|
|
|
|
var_opt_char[0] = "optimize";
|
|
|
|
var_opt_char[1] = "optimize_size";
|
|
|
|
var_opt_range["optimize"] = "0, 255";
|
|
|
|
var_opt_range["optimize_size"] = "0, 255";
|
|
|
|
|
|
|
|
# Sort by size to mimic how the structure is laid out to be friendlier to the
|
|
|
|
# cache.
|
|
|
|
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
if (flag_set_p("Optimization", flags[i])) {
|
|
|
|
name = var_name(flags[i])
|
|
|
|
if(name == "")
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if(name in var_opt_seen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
var_opt_seen[name]++;
|
|
|
|
otype = var_type_struct(flags[i]);
|
|
|
|
if (otype ~ "^((un)?signed +)?int *$")
|
|
|
|
var_opt_int[n_opt_int++] = name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?short *$")
|
|
|
|
var_opt_short[n_opt_short++] = name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?char *$") {
|
|
|
|
var_opt_char[n_opt_char++] = name;
|
|
|
|
if (otype ~ "^unsigned +char *$")
|
|
|
|
var_opt_range[name] = "0, 255"
|
|
|
|
else if (otype ~ "^signed +char *$")
|
|
|
|
var_opt_range[name] = "-128, 127"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
var_opt_other[n_opt_other++] = name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_char; i++) {
|
|
|
|
name = var_opt_char[i];
|
|
|
|
if (var_opt_range[name] != "")
|
|
|
|
print " gcc_assert (IN_RANGE (" name ", " var_opt_range[name] "));";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "";
|
|
|
|
for (i = 0; i < n_opt_other; i++) {
|
|
|
|
print " ptr->" var_opt_other[i] " = " var_opt_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_int; i++) {
|
|
|
|
print " ptr->" var_opt_int[i] " = " var_opt_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_short; i++) {
|
|
|
|
print " ptr->" var_opt_short[i] " = " var_opt_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_char; i++) {
|
|
|
|
print " ptr->" var_opt_char[i] " = " var_opt_char[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "}";
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print "/* Restore optimization options from a structure. */";
|
|
|
|
print "void";
|
|
|
|
print "cl_optimization_restore (struct cl_optimization *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_other; i++) {
|
|
|
|
print " " var_opt_other[i] " = ptr->" var_opt_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_int; i++) {
|
|
|
|
print " " var_opt_int[i] " = ptr->" var_opt_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_short; i++) {
|
|
|
|
print " " var_opt_short[i] " = ptr->" var_opt_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_char; i++) {
|
|
|
|
print " " var_opt_char[i] " = ptr->" var_opt_char[i] ";";
|
|
|
|
}
|
|
|
|
|
2009-10-29 17:44:02 +01:00
|
|
|
print " targetm.override_options_after_change ();";
|
2008-07-23 12:28:06 +02:00
|
|
|
print "}";
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print "/* Print optimization options from a structure. */";
|
|
|
|
print "void";
|
|
|
|
print "cl_optimization_print (FILE *file,";
|
|
|
|
print " int indent_to,";
|
|
|
|
print " struct cl_optimization *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
print " fputs (\"\\n\", file);";
|
|
|
|
for (i = 0; i < n_opt_other; i++) {
|
|
|
|
print " if (ptr->" var_opt_other[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#lx)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent_to, \"\",";
|
|
|
|
print " \"" var_opt_other[i] "\",";
|
|
|
|
print " (unsigned long)ptr->" var_opt_other[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_int; i++) {
|
|
|
|
print " if (ptr->" var_opt_int[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent_to, \"\",";
|
|
|
|
print " \"" var_opt_int[i] "\",";
|
|
|
|
print " ptr->" var_opt_int[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_short; i++) {
|
|
|
|
print " if (ptr->" var_opt_short[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent_to, \"\",";
|
|
|
|
print " \"" var_opt_short[i] "\",";
|
|
|
|
print " ptr->" var_opt_short[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_char; i++) {
|
|
|
|
print " if (ptr->" var_opt_char[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent_to, \"\",";
|
|
|
|
print " \"" var_opt_char[i] "\",";
|
|
|
|
print " ptr->" var_opt_char[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "}";
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print "/* Save selected option variables into a structure. */"
|
|
|
|
print "void";
|
|
|
|
print "cl_target_option_save (struct cl_target_option *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
n_target_char = 0;
|
|
|
|
n_target_short = 0;
|
|
|
|
n_target_int = 0;
|
|
|
|
n_target_other = 0;
|
|
|
|
|
|
|
|
if (have_save) {
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
if (flag_set_p("Save", flags[i])) {
|
|
|
|
name = var_name(flags[i])
|
|
|
|
if(name == "")
|
|
|
|
name = "target_flags";
|
|
|
|
|
|
|
|
if(name in var_save_seen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
var_save_seen[name]++;
|
|
|
|
otype = var_type_struct(flags[i])
|
|
|
|
if (otype ~ "^((un)?signed +)?int *$")
|
|
|
|
var_target_int[n_target_int++] = name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?short *$")
|
|
|
|
var_target_short[n_target_short++] = name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?char *$") {
|
|
|
|
var_target_char[n_target_char++] = name;
|
|
|
|
if (otype ~ "^unsigned +char *$")
|
|
|
|
var_target_range[name] = "0, 255"
|
|
|
|
else if (otype ~ "^signed +char *$")
|
|
|
|
var_target_range[name] = "-128, 127"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
var_target_other[n_target_other++] = name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
var_target_int[n_target_int++] = "target_flags";
|
|
|
|
}
|
|
|
|
|
|
|
|
have_assert = 0;
|
|
|
|
for (i = 0; i < n_target_char; i++) {
|
|
|
|
name = var_target_char[i];
|
|
|
|
if (var_target_range[name] != "") {
|
|
|
|
have_assert = 1;
|
|
|
|
print " gcc_assert (IN_RANGE (" name ", " var_target_range[name] "));";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (have_assert)
|
|
|
|
print "";
|
|
|
|
|
|
|
|
print " if (targetm.target_option.save)";
|
|
|
|
print " targetm.target_option.save (ptr);";
|
|
|
|
print "";
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_other; i++) {
|
|
|
|
print " ptr->" var_target_other[i] " = " var_target_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_int; i++) {
|
|
|
|
print " ptr->" var_target_int[i] " = " var_target_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_short; i++) {
|
|
|
|
print " ptr->" var_target_short[i] " = " var_target_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_char; i++) {
|
|
|
|
print " ptr->" var_target_char[i] " = " var_target_char[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "}";
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print "/* Restore selected current options from a structure. */";
|
|
|
|
print "void";
|
|
|
|
print "cl_target_option_restore (struct cl_target_option *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_other; i++) {
|
|
|
|
print " " var_target_other[i] " = ptr->" var_target_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_int; i++) {
|
|
|
|
print " " var_target_int[i] " = ptr->" var_target_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_short; i++) {
|
|
|
|
print " " var_target_short[i] " = ptr->" var_target_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_char; i++) {
|
|
|
|
print " " var_target_char[i] " = ptr->" var_target_char[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
# This must occur after the normal variables in case the code depends on those
|
|
|
|
# variables.
|
|
|
|
print "";
|
|
|
|
print " if (targetm.target_option.restore)";
|
|
|
|
print " targetm.target_option.restore (ptr);";
|
|
|
|
|
|
|
|
print "}";
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print "/* Print optimization options from a structure. */";
|
|
|
|
print "void";
|
|
|
|
print "cl_target_option_print (FILE *file,";
|
|
|
|
print " int indent,";
|
|
|
|
print " struct cl_target_option *ptr)";
|
|
|
|
print "{";
|
|
|
|
|
|
|
|
print " fputs (\"\\n\", file);";
|
|
|
|
for (i = 0; i < n_target_other; i++) {
|
|
|
|
print " if (ptr->" var_target_other[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#lx)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent, \"\",";
|
|
|
|
print " \"" var_target_other[i] "\",";
|
|
|
|
print " (unsigned long)ptr->" var_target_other[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_int; i++) {
|
|
|
|
print " if (ptr->" var_target_int[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent, \"\",";
|
|
|
|
print " \"" var_target_int[i] "\",";
|
|
|
|
print " ptr->" var_target_int[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_short; i++) {
|
|
|
|
print " if (ptr->" var_target_short[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent, \"\",";
|
|
|
|
print " \"" var_target_short[i] "\",";
|
|
|
|
print " ptr->" var_target_short[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_char; i++) {
|
|
|
|
print " if (ptr->" var_target_char[i] ")";
|
2010-05-02 14:31:18 +02:00
|
|
|
print " fprintf (file, \"%*s%s (%#x)\\n\",";
|
2008-07-23 12:28:06 +02:00
|
|
|
print " indent, \"\",";
|
|
|
|
print " \"" var_target_char[i] "\",";
|
|
|
|
print " ptr->" var_target_char[i] ");";
|
|
|
|
print "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "";
|
|
|
|
print " if (targetm.target_option.print)";
|
|
|
|
print " targetm.target_option.print (file, indent, ptr);";
|
|
|
|
|
|
|
|
print "}";
|
|
|
|
print "#endif";
|
|
|
|
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|