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,2005,2006,2007,2008, 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
|
|
|
|
# opt-gather.awk, combines the flags of duplicate options and generates a
|
|
|
|
# C header file.
|
|
|
|
#
|
|
|
|
# This program uses functions from opt-functions.awk
|
|
|
|
# Usage: awk -f opt-functions.awk -f opth-gen.awk < inputfile > options.h
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
n_opts = 0
|
|
|
|
n_langs = 0
|
2008-07-23 12:28:06 +02:00
|
|
|
n_target_save = 0
|
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_extra_masks = 0
|
|
|
|
quote = "\042"
|
2004-06-18 03:59:45 +02:00
|
|
|
comma = ","
|
|
|
|
FS=SUBSEP
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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
|
|
|
|
n_opts++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
extra_masks[n_extra_masks++] = name
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Dump out an enumeration into a .h file.
|
|
|
|
# Combine the flags of duplicate options.
|
|
|
|
END {
|
2007-10-10 15:07:43 +02:00
|
|
|
print "/* This file is auto-generated by opth-gen.awk. */"
|
2004-06-18 03:59:45 +02:00
|
|
|
print ""
|
|
|
|
print "#ifndef OPTIONS_H"
|
|
|
|
print "#define OPTIONS_H"
|
|
|
|
print ""
|
2005-03-14 21:18:43 +01:00
|
|
|
print "extern int target_flags;"
|
2007-09-23 21:18:27 +02:00
|
|
|
print "extern int target_flags_explicit;"
|
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
|
|
|
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;
|
|
|
|
|
2008-07-23 12:28:06 +02:00
|
|
|
if (name in var_seen)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
var_seen[name] = 1;
|
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 "extern " var_type(flags[i]) name ";"
|
|
|
|
}
|
|
|
|
print ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
2008-07-23 12:28:06 +02:00
|
|
|
# All of the optimization switches gathered together so they can be saved and restored.
|
|
|
|
# This will allow attribute((cold)) to turn on space optimization.
|
|
|
|
|
|
|
|
# Change the type of normal switches from int to unsigned char to save space.
|
|
|
|
# Also, order the structure so that pointer fields occur first, then int
|
|
|
|
# fields, and then char fields to provide the best packing.
|
|
|
|
|
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 "/* Structure to save/restore optimization and target specific options. */";
|
2009-04-22 20:29:36 +02:00
|
|
|
print "struct GTY(()) cl_optimization";
|
2008-07-23 12:28:06 +02:00
|
|
|
print "{";
|
|
|
|
|
|
|
|
n_opt_char = 2;
|
|
|
|
n_opt_short = 0;
|
|
|
|
n_opt_int = 0;
|
|
|
|
n_opt_other = 0;
|
|
|
|
var_opt_char[0] = "unsigned char optimize";
|
|
|
|
var_opt_char[1] = "unsigned char optimize_size";
|
|
|
|
|
|
|
|
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++] = otype name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?short *$")
|
|
|
|
var_opt_short[n_opt_short++] = otype name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?char *$")
|
|
|
|
var_opt_char[n_opt_char++] = otype name;
|
|
|
|
|
|
|
|
else
|
|
|
|
var_opt_other[n_opt_other++] = otype name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_other; i++) {
|
|
|
|
print " " var_opt_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_int; i++) {
|
|
|
|
print " " var_opt_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_short; i++) {
|
|
|
|
print " " var_opt_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_opt_char; i++) {
|
|
|
|
print " " var_opt_char[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "};";
|
|
|
|
print "";
|
|
|
|
|
|
|
|
# Target and optimization save/restore/print functions.
|
|
|
|
print "/* Structure to save/restore selected target specific options. */";
|
2009-04-22 20:29:36 +02:00
|
|
|
print "struct GTY(()) cl_target_option";
|
2008-07-23 12:28:06 +02:00
|
|
|
print "{";
|
|
|
|
|
|
|
|
n_target_char = 0;
|
|
|
|
n_target_short = 0;
|
|
|
|
n_target_int = 0;
|
|
|
|
n_target_other = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_save; i++) {
|
|
|
|
if (target_save_decl[i] ~ "^((un)?signed +)?int +[_a-zA-Z0-9]+$")
|
|
|
|
var_target_int[n_target_int++] = target_save_decl[i];
|
|
|
|
|
|
|
|
else if (target_save_decl[i] ~ "^((un)?signed +)?short +[_a-zA-Z0-9]+$")
|
|
|
|
var_target_short[n_target_short++] = target_save_decl[i];
|
|
|
|
|
|
|
|
else if (target_save_decl[i] ~ "^((un)?signed +)?char +[_a-zA-Z0-9]+$")
|
|
|
|
var_target_char[n_target_char++] = target_save_decl[i];
|
|
|
|
|
|
|
|
else
|
|
|
|
var_target_other[n_target_other++] = target_save_decl[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
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++] = otype name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?short *$")
|
|
|
|
var_target_short[n_target_short++] = otype name;
|
|
|
|
|
|
|
|
else if (otype ~ "^((un)?signed +)?char *$")
|
|
|
|
var_target_char[n_target_char++] = otype name;
|
|
|
|
|
|
|
|
else
|
|
|
|
var_target_other[n_target_other++] = otype name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
var_target_int[n_target_int++] = "int target_flags";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_other; i++) {
|
|
|
|
print " " var_target_other[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_int; i++) {
|
|
|
|
print " " var_target_int[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_short; i++) {
|
|
|
|
print " " var_target_short[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n_target_char; i++) {
|
|
|
|
print " " var_target_char[i] ";";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "};";
|
|
|
|
print "";
|
|
|
|
print "";
|
|
|
|
print "/* Save optimization variables into a structure. */"
|
|
|
|
print "extern void cl_optimization_save (struct cl_optimization *);";
|
|
|
|
print "";
|
|
|
|
print "/* Restore optimization variables from a structure. */";
|
|
|
|
print "extern void cl_optimization_restore (struct cl_optimization *);";
|
|
|
|
print "";
|
|
|
|
print "/* Print optimization variables from a structure. */";
|
|
|
|
print "extern void cl_optimization_print (FILE *, int, struct cl_optimization *);";
|
|
|
|
print "";
|
|
|
|
print "/* Save selected option variables into a structure. */"
|
|
|
|
print "extern void cl_target_option_save (struct cl_target_option *);";
|
|
|
|
print "";
|
|
|
|
print "/* Restore selected option variables from a structure. */"
|
|
|
|
print "extern void cl_target_option_restore (struct cl_target_option *);";
|
|
|
|
print "";
|
|
|
|
print "/* Print target option variables from a structure. */";
|
|
|
|
print "extern void cl_target_option_print (FILE *, int, struct cl_target_option *);";
|
|
|
|
print "#endif";
|
|
|
|
print "";
|
|
|
|
|
2005-03-14 21:18:43 +01:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = opt_args("Mask", flags[i])
|
2005-04-28 22:52:12 +02:00
|
|
|
vname = var_name(flags[i])
|
|
|
|
mask = "MASK_"
|
|
|
|
if (vname != "") {
|
|
|
|
mask = "OPTION_MASK_"
|
|
|
|
}
|
2005-03-30 08:26:20 +02:00
|
|
|
if (name != "" && !flag_set_p("MaskExists", flags[i]))
|
2005-04-28 22:52:12 +02:00
|
|
|
print "#define " mask name " (1 << " masknum[vname]++ ")"
|
2005-03-14 21:18:43 +01:00
|
|
|
}
|
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
|
|
|
for (i = 0; i < n_extra_masks; i++) {
|
2005-04-28 22:52:12 +02:00
|
|
|
print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")"
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var in masknum) {
|
|
|
|
if (masknum[var] > 31) {
|
|
|
|
if (var == "")
|
|
|
|
print "#error too many target masks"
|
|
|
|
else
|
|
|
|
print "#error too many masks for " var
|
|
|
|
}
|
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
|
|
|
}
|
2005-03-14 21:18:43 +01:00
|
|
|
print ""
|
|
|
|
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
name = opt_args("Mask", flags[i])
|
2005-04-28 22:52:12 +02:00
|
|
|
vname = var_name(flags[i])
|
|
|
|
macro = "OPTION_"
|
|
|
|
mask = "OPTION_MASK_"
|
|
|
|
if (vname == "") {
|
|
|
|
vname = "target_flags"
|
|
|
|
macro = "TARGET_"
|
|
|
|
mask = "MASK_"
|
|
|
|
}
|
2005-03-30 08:26:20 +02:00
|
|
|
if (name != "" && !flag_set_p("MaskExists", flags[i]))
|
2005-04-28 22:52:12 +02:00
|
|
|
print "#define " macro name \
|
|
|
|
" ((" vname " & " mask name ") != 0)"
|
2005-03-14 21:18:43 +01:00
|
|
|
}
|
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
|
|
|
for (i = 0; i < n_extra_masks; i++) {
|
|
|
|
print "#define TARGET_" extra_masks[i] \
|
|
|
|
" ((target_flags & MASK_" extra_masks[i] ") != 0)"
|
|
|
|
}
|
2005-03-14 21:18:43 +01:00
|
|
|
print ""
|
|
|
|
|
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
opt = opt_args("InverseMask", flags[i])
|
re PR target/24837 (move dynamic linker names out of LINK_SPEC and into new DYNAMIC_LINKER)
PR target/24837
* config.gcc: Define UCLIBC_DEFAULT to 0 or 1.
* opth-gen.awk: Handle Var and InverseMask together.
* config/linux.opt (muclibc, mglibc): Use Var(linux_uclibc).
* config/linux.h: Use #if not #ifdef for testing UCLIBC_DEFAULT.
(TARGET_C99_FUNCTIONS): Test OPTION_GLIBC not TARGET_GLIBC.
(CHOOSE_DYNAMIC_LINKER): Give an error for -mglibc and -muclibc
used together.
(UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64,
LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define.
* config/alpha/linux-elf.h (GLIBC_DYNAMIC_LINKER,
UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER,
LINUX_DYNAMIC_LINKER): Define.
(ELF_DYNAMIC_LINKER): Define to LINUX_DYNAMIC_LINKER.
* config/alpha/linux.h (TARGET_C99_FUNCTIONS): Define to
TARGET_GLIBC.
* config/cris/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(CRIS_LINK_SUBTARGET_SPEC): Pass a -dynamic-linker option.
* config/frv/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
(TARGET_C99_FUNCTIONS): Don't define.
* config/i386/linux.h (DYNAMIC_LINKER): Rename to
GLIBC_DYNAMIC_LINKER.
(SUBTARGET_EXTRA_SPECS): Use LINUX_DYNAMIC_LINKER.
* config/i386/linux64.h (GLIBC_DYNAMIC_LINKER32,
GLIBC_DYNAMIC_LINKER64): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER32 and
LINUX_DYNAMIC_LINKER64.
* config/ia64/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/m32r/linux.h (GLIBC_DYNAMIC_LINKE): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/m68k/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/mips/linux64.h (GLIBC_DYNAMIC_LINKER32,
GLIBC_DYNAMIC_LINKER64, GLIBC_DYNAMIC_LINKERN32,
UCLIBC_DYNAMIC_LINKERN32, LINUX_DYNAMIC_LINKERN32): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKERN32, LINUX_DYNAMIC_LINKER64
and LINUX_DYNAMIC_LINKER32.
* config/mn10300/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/pa/pa-linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/rs6000/linux.h (TARGET_C99_FUNCTIONS): Define to
TARGET_GLIBC.
* config/rs6000/linux64.h (TARGET_C99_FUNCTIONS): Likewise.
(GLIBC_DYNAMIC_LINKER32, GLIBC_DYNAMIC_LINKER64,
UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64,
CHOOSE_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER,
LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define.
(LINK_OS_LINUX_SPEC32): Use LINUX_DYNAMIC_LINKER32.
(LINK_OS_LINUX_SPEC64): Use LINUX_DYNAMIC_LINKER64.
* config/rs6000/sysv4.h (GLIBC_DYNAMIC_LINKER,
UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER,
LINUX_DYNAMIC_LINKER): Define.
(LINK_OS_LINUX_SPEC): Use LINUX_DYNAMIC_LINKE.
* config/s390/linux.h (GLIBC_DYNAMIC_LINKER32,
GLIBC_DYNAMIC_LINKER64): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER32 and
LINUX_DYNAMIC_LINKER64.
* config/sh/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(SUBTARGET_LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* config/sparc/linux.h (GLIBC_DYNAMIC_LINKER,
UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER,
LINUX_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
(TARGET_C99_FUNCTIONS): Define to TARGET_GLIBC.
* config/sparc/linux64.h (GLIBC_DYNAMIC_LINKER32,
GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER32,
UCLIBC_DYNAMIC_LINKER64, CHOOSE_DYNAMIC_LINKER,
LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Define.
(LINK_ARCH32_SPEC): Use LINUX_DYNAMIC_LINKER32.
(LINK_ARCH64_SPEC, LINK_SPEC): Use LINUX_DYNAMIC_LINKER64.
(TARGET_C99_FUNCTIONS): Define to TARGET_GLIBC.
* config/xtensa/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
* doc/invoke.texi (-muclibc): Remove caveat about supported
targets.
testsuite:
* gcc.dg/glibc-uclibc-1.c, gcc.dg/glibc-uclibc-2.c: New tests.
From-SVN: r111235
2006-02-18 12:12:51 +01:00
|
|
|
if (opt ~ ",") {
|
|
|
|
vname = var_name(flags[i])
|
|
|
|
macro = "OPTION_"
|
|
|
|
mask = "OPTION_MASK_"
|
|
|
|
if (vname == "") {
|
|
|
|
vname = "target_flags"
|
|
|
|
macro = "TARGET_"
|
|
|
|
mask = "MASK_"
|
|
|
|
}
|
|
|
|
print "#define " macro nth_arg(1, opt) \
|
|
|
|
" ((" vname " & " mask nth_arg(0, opt) ") == 0)"
|
|
|
|
}
|
2005-03-14 21:18:43 +01:00
|
|
|
}
|
|
|
|
print ""
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
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 "#define " macros[i] s " (1 << " i ")"
|
|
|
|
}
|
2007-03-06 01:48:47 +01:00
|
|
|
print "#define CL_LANG_ALL ((1 << " n_langs ") - 1)"
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
print ""
|
|
|
|
print "enum opt_code"
|
|
|
|
print "{"
|
|
|
|
|
|
|
|
for (i = 0; i < n_opts; i++)
|
|
|
|
back_chain[i] = "N_OPTS";
|
|
|
|
|
2005-05-15 10:16:01 +02:00
|
|
|
for (i = 0; i < n_opts; i++) {
|
|
|
|
# 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];
|
|
|
|
i++;
|
|
|
|
}
|
2004-06-18 03:59:45 +02:00
|
|
|
|
|
|
|
len = length (opts[i]);
|
|
|
|
enum = "OPT_" opts[i]
|
2010-02-24 21:41:01 +01:00
|
|
|
if (opts[i] == "finline-limit=" || opts[i] == "Wlarger-than=" \
|
|
|
|
|| opts[i] == "ftemplate-depth=")
|
2004-06-18 03:59:45 +02:00
|
|
|
enum = enum "eq"
|
2009-06-12 05:08:11 +02:00
|
|
|
if (opts[i] == "gdwarf+")
|
|
|
|
enum = "OPT_gdwarfplus"
|
2004-06-18 03:59:45 +02:00
|
|
|
gsub ("[^A-Za-z0-9]", "_", enum)
|
|
|
|
|
|
|
|
# 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.
|
2005-03-30 08:24:35 +02:00
|
|
|
if (flag_set_p("Joined.*", flags[i])) {
|
2004-06-18 03:59:45 +02:00
|
|
|
for (j = i + 1; j < n_opts; j++) {
|
|
|
|
if (substr (opts[j], 1, len) != opts[i])
|
|
|
|
break;
|
|
|
|
back_chain[j] = enum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-12 05:08:11 +02:00
|
|
|
s = substr(" ", length (enum))
|
2004-06-18 03:59:45 +02:00
|
|
|
if (i + 1 == n_opts)
|
|
|
|
comma = ""
|
|
|
|
|
|
|
|
if (help[i] == "")
|
|
|
|
hlp = "0"
|
|
|
|
else
|
|
|
|
hlp = "N_(\"" help[i] "\")";
|
|
|
|
|
|
|
|
print " " enum "," s "/* -" opts[i] " */"
|
|
|
|
}
|
|
|
|
|
|
|
|
print " N_OPTS"
|
|
|
|
print "};"
|
|
|
|
print ""
|
|
|
|
print "#endif /* OPTIONS_H */"
|
|
|
|
}
|