gcc/gcc/opts.h

83 lines
2.6 KiB
C
Raw Normal View History

Makefile.in (OJBS, c-opts.o): Update. * Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-07 13:10:46 +02:00
/* Command line option handling.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Makefile.in (OJBS, c-opts.o): Update. * Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-07 13:10:46 +02:00
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC 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
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef GCC_OPTS_H
#define GCC_OPTS_H
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
/* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */
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
enum cl_var_type {
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
/* The switch is enabled when FLAG_VAR is nonzero. */
CLVC_BOOLEAN,
/* The switch is enabled when FLAG_VAR == VAR_VALUE. */
CLVC_EQUAL,
/* The switch is enabled when VAR_VALUE is not set in FLAG_VAR. */
CLVC_BIT_CLEAR,
/* The switch is enabled when VAR_VALUE is set in FLAG_VAR. */
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
CLVC_BIT_SET,
/* The switch takes a string argument and FLAG_VAR points to that
argument. */
CLVC_STRING
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
};
Makefile.in (OJBS, c-opts.o): Update. * Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-07 13:10:46 +02:00
struct cl_option
{
const char *opt_text;
const char *help;
unsigned short back_chain;
unsigned char opt_len;
Makefile.in: Update to use common.opt and lang_opt_files. * Makefile.in: Update to use common.opt and lang_opt_files. (c-options.c, c-options.h): Remove. (options.c, options.h): Add. * c-opts.c: Include options.h not c-options.h. * common.opt: New file. * configure, configure.in: Add lang_opt_files. * opts.c: Include flags.h and diagnostic.h. (common_handle_option): New. (handle_option): Update to recognize common options and all language-dependent options. * opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New. (struct cl_option): Make flags of type int. * opts.h: Flag option with front ends to which it applies. Handle duplicate options. * toplev.c (filename): Remove. (independent_decode_option): Don't handle filenames and -quiet. (process_options, do_compile): Update. ada: * Make-lang.in: Update to use options.c and options.h. * misc.c: Include options.h not aoptions.h. (gnat_handle_option): Abort on unrecognized switch. (gnat_init_options): Request Ada switches. cp: * Make-lang.in: Remove c-options.o. f: * Make-lang.in: Update to use options.c and options.h. * top.c: Include options.h not f-options.h. (gnat_handle_option): Abort on unrecognized switch. (ffe_init_options): From com.c. Request F77 options. (ffe_handle_options): Abort on unrecognized switch. * com.c (ffe_init_options): Move to top.c. * top.h (fee_init_options): New. java: * Make-lang.in: Update to use options.c and options.h. * lang.c: Include options.h not j-options.h. (java_handle_option): Abort on unrecognized option. (java_init_options): Request Java switches. treelang: * Make-lang.in: Update to use options.c and options.h. * tree1.c: Include options.h not t-options.h. (treelang_init_options): New. (treelang_handle_option): Abort on unrecognized switch. * treetree.c (LANG_HOOKS_INIT_OPTIONS): Override. * treetree.h (treelang_init_options): New. From-SVN: r67941
2003-06-14 14:26:36 +02:00
unsigned int flags;
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
void *flag_var;
enum cl_var_type var_type;
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
int var_value;
};
extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
extern const char *const lang_names[];
#define CL_DISABLED (1 << 21) /* Disabled in this configuration. */
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
#define CL_TARGET (1 << 22) /* Target-specific option. */
#define CL_REPORT (1 << 23) /* Report argument with -fverbose-asm */
Makefile.in: Update to use common.opt and lang_opt_files. * Makefile.in: Update to use common.opt and lang_opt_files. (c-options.c, c-options.h): Remove. (options.c, options.h): Add. * c-opts.c: Include options.h not c-options.h. * common.opt: New file. * configure, configure.in: Add lang_opt_files. * opts.c: Include flags.h and diagnostic.h. (common_handle_option): New. (handle_option): Update to recognize common options and all language-dependent options. * opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New. (struct cl_option): Make flags of type int. * opts.h: Flag option with front ends to which it applies. Handle duplicate options. * toplev.c (filename): Remove. (independent_decode_option): Don't handle filenames and -quiet. (process_options, do_compile): Update. ada: * Make-lang.in: Update to use options.c and options.h. * misc.c: Include options.h not aoptions.h. (gnat_handle_option): Abort on unrecognized switch. (gnat_init_options): Request Ada switches. cp: * Make-lang.in: Remove c-options.o. f: * Make-lang.in: Update to use options.c and options.h. * top.c: Include options.h not f-options.h. (gnat_handle_option): Abort on unrecognized switch. (ffe_init_options): From com.c. Request F77 options. (ffe_handle_options): Abort on unrecognized switch. * com.c (ffe_init_options): Move to top.c. * top.h (fee_init_options): New. java: * Make-lang.in: Update to use options.c and options.h. * lang.c: Include options.h not j-options.h. (java_handle_option): Abort on unrecognized option. (java_init_options): Request Java switches. treelang: * Make-lang.in: Update to use options.c and options.h. * tree1.c: Include options.h not t-options.h. (treelang_init_options): New. (treelang_handle_option): Abort on unrecognized switch. * treetree.c (LANG_HOOKS_INIT_OPTIONS): Override. * treetree.h (treelang_init_options): New. From-SVN: r67941
2003-06-14 14:26:36 +02:00
#define CL_JOINED (1 << 24) /* If takes joined argument. */
#define CL_SEPARATE (1 << 25) /* If takes a separate argument. */
#define CL_REJECT_NEGATIVE (1 << 26) /* Reject no- form. */
#define CL_MISSING_OK (1 << 27) /* Missing argument OK (joined). */
#define CL_UINTEGER (1 << 28) /* Argument is an integer >=0. */
#define CL_COMMON (1 << 29) /* Language-independent. */
#define CL_UNDOCUMENTED (1 << 30) /* Do not output with --help. */
Makefile.in (OJBS, c-opts.o): Update. * Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-07 13:10:46 +02:00
/* Input file names. */
extern const char **in_fnames;
/* The count of input filenames. */
extern unsigned num_in_fnames;
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
extern void decode_options (unsigned int argc, const char **argv);
extern int option_enabled (int opt_idx);
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
extern void print_filtered_help (unsigned int);
Makefile.in (OJBS, c-opts.o): Update. * Makefile.in (OJBS, c-opts.o): Update. (c-options.c, c-options.h): Rename options.h and options.c. (options.h): Rename options_.h. (opts.o): New. * c-common.h (c_common_handle_option): Replace c_common_decode_option. (c_common_init_options): Update prototype. * c-lang.c (c_init_options): Update prototype. (LANG_HOOKS_HANDLE_OPTION): Override. (LANG_HOOKS_DECODE_OPTION): Drop. * c-opts.c: Include opts.h and options.h instead of c-options.h and c-options.c. (lang_flags): Move to file scope. (find_opt, c_common_decode_option): Remove. (CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE, CL_REJECT_NEGATIVE): Move to opts.h. (missing_arg): Update prototype. (c_common_init_options): Update for new prototype. (c_common_handle_options): Filenames are passed as N_OPTS. * hooks.c (hook_int_void_0): New. * hooks.h (hook_int_void_0): New. * langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default. (LANG_HOOKS_HANDLE_OPTION): Default to NULL for now. (LANG_HOOKS_INITIALIZER): Update. * langhooks.h (init_options): Update. (handle_option): New. * opts.c, opts.h: New files. * opts.sh: Update c file to include opts.h and options.h. * toplev.c: Include opts.h; change options.h to options_.h. (parse_options_and_default_flags): Get lang_mask, use handle_option for language-specific handling. * objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. (objc_init_options): Update. ada: * misc.c (gnat_init_options): Update. cp: * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. (LANG_HOOKS_HANDLE_OPTION): Override. * cp-tree.h (cxx_init_options): Update. * lex.c (cxx_init_options): Update. f: * com.c (ffe_init_options): Update. java: * lang.c (java_init_options): Update. From-SVN: r67584
2003-06-07 13:10:46 +02:00
#endif