2002-08-07 20:32:13 +02:00
|
|
|
/* C/ObjC/C++ command line option handling.
|
2006-01-20 22:00:03 +01:00
|
|
|
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
2002-08-07 20:32:13 +02:00
|
|
|
Contributed by Neil Booth.
|
|
|
|
|
|
|
|
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
|
2005-06-25 04:02:01 +02:00
|
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA. */
|
2002-08-07 20:32:13 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
2002-08-07 20:32:13 +02:00
|
|
|
#include "tree.h"
|
|
|
|
#include "c-common.h"
|
|
|
|
#include "c-pragma.h"
|
|
|
|
#include "flags.h"
|
|
|
|
#include "toplev.h"
|
|
|
|
#include "langhooks.h"
|
|
|
|
#include "tree-inline.h"
|
|
|
|
#include "diagnostic.h"
|
2002-08-09 08:19:08 +02:00
|
|
|
#include "intl.h"
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
#include "cppdefault.h"
|
|
|
|
#include "c-incpath.h"
|
2003-03-14 22:47:50 +01:00
|
|
|
#include "debug.h" /* For debug_hooks. */
|
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
|
|
|
#include "opts.h"
|
2003-06-14 14:26:36 +02:00
|
|
|
#include "options.h"
|
2004-06-05 22:58:06 +02:00
|
|
|
#include "mkdeps.h"
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
|
c-common.c, c-common.h (dollars_in_ident): Remove.
* c-common.c, c-common.h (dollars_in_ident): Remove.
* c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true.
(c_common_init_options, c_common_decode_option): Set dollars_in_ident.
* cpphash.h (warned_dollar): Rename warn_dollars.
* cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang)
Permit dollars regardless of -std=.
(post_options): Set warn_dollars.
* cpplex.c (forms_identifier_p): Use warn_dollars.
* config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h:
Remove redundant definitions of DOLLARS_IN_IDENTIFIERS.
* doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi:
Update documentation.
testsuite:
* gcc.dg/dollar.c: New test.
From-SVN: r66911
2003-05-17 22:29:34 +02:00
|
|
|
#ifndef DOLLARS_IN_IDENTIFIERS
|
|
|
|
# define DOLLARS_IN_IDENTIFIERS true
|
|
|
|
#endif
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
#ifndef TARGET_SYSTEM_ROOT
|
|
|
|
# define TARGET_SYSTEM_ROOT NULL
|
|
|
|
#endif
|
2002-08-07 20:32:13 +02:00
|
|
|
|
2004-03-04 03:39:37 +01:00
|
|
|
#ifndef TARGET_OPTF
|
|
|
|
#define TARGET_OPTF(ARG)
|
|
|
|
#endif
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
/* CPP's options. */
|
2002-08-08 08:30:13 +02:00
|
|
|
static cpp_options *cpp_opts;
|
|
|
|
|
2002-08-12 08:02:53 +02:00
|
|
|
/* Input filename. */
|
2003-07-17 23:50:38 +02:00
|
|
|
static const char *this_input_filename;
|
2002-08-12 08:02:53 +02:00
|
|
|
|
2002-08-12 00:22:28 +02:00
|
|
|
/* Filename and stream for preprocessed output. */
|
|
|
|
static const char *out_fname;
|
|
|
|
static FILE *out_stream;
|
|
|
|
|
|
|
|
/* Append dependencies to deps_file. */
|
|
|
|
static bool deps_append;
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
/* If dependency switches (-MF etc.) have been given. */
|
|
|
|
static bool deps_seen;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
/* If -v seen. */
|
|
|
|
static bool verbose;
|
|
|
|
|
2005-11-04 09:29:16 +01:00
|
|
|
/* If -lang-fortran seen. */
|
|
|
|
static bool lang_fortran = false;
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
/* Dependency output file. */
|
|
|
|
static const char *deps_file;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
/* The prefix given by -iprefix, if any. */
|
|
|
|
static const char *iprefix;
|
|
|
|
|
2006-01-20 22:00:03 +01:00
|
|
|
/* The multilib directory given by -imultilib, if any. */
|
|
|
|
static const char *imultilib;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
/* The system root, if any. Overridden by -isysroot. */
|
|
|
|
static const char *sysroot = TARGET_SYSTEM_ROOT;
|
|
|
|
|
|
|
|
/* Zero disables all standard directories for headers. */
|
|
|
|
static bool std_inc = true;
|
|
|
|
|
|
|
|
/* Zero disables the C++-specific standard directories for headers. */
|
|
|
|
static bool std_cxx_inc = true;
|
|
|
|
|
|
|
|
/* If the quote chain has been split by -I-. */
|
|
|
|
static bool quote_chain_split;
|
|
|
|
|
2003-03-14 22:47:50 +01:00
|
|
|
/* If -Wunused-macros. */
|
|
|
|
static bool warn_unused_macros;
|
|
|
|
|
2004-02-19 23:18:50 +01:00
|
|
|
/* If -Wvariadic-macros. */
|
|
|
|
static bool warn_variadic_macros = true;
|
|
|
|
|
2003-07-02 22:15:46 +02:00
|
|
|
/* Number of deferred options. */
|
|
|
|
static size_t deferred_count;
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
|
2003-03-14 22:47:50 +01:00
|
|
|
/* Number of deferred options scanned for -include. */
|
|
|
|
static size_t include_cursor;
|
|
|
|
|
2003-06-22 15:41:26 +02:00
|
|
|
static void set_Wimplicit (int);
|
|
|
|
static void handle_OPT_d (const char *);
|
|
|
|
static void set_std_cxx98 (int);
|
2006-11-01 17:29:06 +01:00
|
|
|
static void set_std_cxx0x (int);
|
2003-06-22 15:41:26 +02:00
|
|
|
static void set_std_c89 (int, int);
|
|
|
|
static void set_std_c99 (int);
|
|
|
|
static void check_deps_environment_vars (void);
|
|
|
|
static void handle_deferred_opts (void);
|
|
|
|
static void sanitize_cpp_opts (void);
|
|
|
|
static void add_prefixed_path (const char *, size_t);
|
|
|
|
static void push_command_line_include (void);
|
|
|
|
static void cb_file_change (cpp_reader *, const struct line_map *);
|
2004-02-05 07:52:26 +01:00
|
|
|
static void cb_dir_change (cpp_reader *, const char *);
|
|
|
|
static void finish_options (void);
|
2002-08-12 08:02:53 +02:00
|
|
|
|
|
|
|
#ifndef STDC_0_IN_SYSTEM_HEADERS
|
|
|
|
#define STDC_0_IN_SYSTEM_HEADERS 0
|
|
|
|
#endif
|
2002-08-07 20:32:13 +02: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
|
|
|
/* Holds switches parsed by c_common_handle_option (), but whose
|
2003-01-18 03:26:43 +01:00
|
|
|
handling is deferred to c_common_post_options (). */
|
2003-06-22 15:41:26 +02:00
|
|
|
static void defer_opt (enum opt_code, const char *);
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
static struct deferred_opt
|
|
|
|
{
|
|
|
|
enum opt_code code;
|
|
|
|
const char *arg;
|
|
|
|
} *deferred_opts;
|
|
|
|
|
c-common.h (c_comon_handle_filename, [...]): New.
* c-common.h (c_comon_handle_filename,
c_common_missing_arguement): New.
* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
* c-opts.c (missing_arg): Rename c_common_missing_argument,
update to be an appropriate langhook.
(c_common_handle_option): Don't handle filenames.
(c_common_handle_filename): New.
* hooks.c (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* hooks.h (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): Add handle_filename and
missing_argument.
* opts.c (handle_option): Don't handle filenames here, but ...
(handle_options): ... here.
(common_handle_option): Don't handle missing arguments here.
* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
ada:
* misc.c (gnat_handle_option): Don't handle filenames.
cp:
* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): Override.
f:
* top.c (ffe_handle_option): Don't handle filenames.
java:
* lang.c (java_handle_option): Don't handle filenames.
From-SVN: r69011
2003-07-06 21:01:21 +02:00
|
|
|
/* Complain that switch CODE expects an argument but none was
|
|
|
|
provided. OPT was the command-line option. Return FALSE to get
|
|
|
|
the default message in opts.c, TRUE if we provide a specialized
|
|
|
|
one. */
|
|
|
|
bool
|
|
|
|
c_common_missing_argument (const char *opt, size_t code)
|
2002-08-09 08:19:08 +02: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
|
|
|
switch (code)
|
2002-08-09 08:19:08 +02:00
|
|
|
{
|
|
|
|
default:
|
c-common.h (c_comon_handle_filename, [...]): New.
* c-common.h (c_comon_handle_filename,
c_common_missing_arguement): New.
* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
* c-opts.c (missing_arg): Rename c_common_missing_argument,
update to be an appropriate langhook.
(c_common_handle_option): Don't handle filenames.
(c_common_handle_filename): New.
* hooks.c (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* hooks.h (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): Add handle_filename and
missing_argument.
* opts.c (handle_option): Don't handle filenames here, but ...
(handle_options): ... here.
(common_handle_option): Don't handle missing arguments here.
* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
ada:
* misc.c (gnat_handle_option): Don't handle filenames.
cp:
* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): Override.
f:
* top.c (ffe_handle_option): Don't handle filenames.
java:
* lang.c (java_handle_option): Don't handle filenames.
From-SVN: r69011
2003-07-06 21:01:21 +02:00
|
|
|
/* Pick up the default message. */
|
|
|
|
return false;
|
2002-08-09 08:19:08 +02:00
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_fconstant_string_class_:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("no class name specified with %qs", opt);
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
2002-08-11 09:32:19 +02:00
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
case OPT_A:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("assertion missing after %qs", opt);
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_D:
|
|
|
|
case OPT_U:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("macro name missing after %qs", opt);
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
break;
|
|
|
|
|
Add framework support for darwin.
* c-incpath.c: Include target.h and machmode.h.
(add_path): Use a consistent style for cpp_dir. Initialize
p->construct to 0.
(add_cpp_dir_path): New.
(register_include_chains): Add use of extra_includes callback.
(hook_void_int): Add.
(target_c_incpath): Add.
* c-incpath.h (add_cpp_dir_path): New.
(target_c_incpath_s): Add.
(target_c_incpath): Add.
(C_INCPATH_INIT): Add.
* c-opts.c (c_common_missing_argument,
c_common_handle_option): Add -F argument processing.
* c.opt: Add -F argument processing.
* gcc.c (trad_capable_cpp): Add -F argument processing.
* cppfiles.c (find_file_in_dir): Update to use construct
callback.
(search_path_exhausted, cpp_get_path, cpp_get_buffer,
cpp_get_prev): New.
(_cpp_find_file): Use search_path_exhausted.
(make_cpp_dir): Initialize construct to 0.
* cpplib.h (missing_header_cb
cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New.
(cpp_callbacks): Add missing_header
(cpp_dir): Add construct.
* target-def.h: (TARGET_OPTF): New.
* hooks.c (hook_void_int, hook_void_charptr): Add.
* hooks.h (hook_void_int, hook_void_charptr): Add.
* Makefile.in (c-incpath.o) : Add $(TARGET_H) and
$(MACHMODE_H) dependencies.
* doc/invoke.texi (Darwin Options): Document -F.
* doc/tm.texi (TARGET_EXTRA_INCLUDES): Add.
(TARGET_OPTF): Add.
* fix-header.c (target_c_incpath): Add.
* config/darwin-c.c: Add c-incpath.h include.
(using_frameworks, find_subframework_file,
find_subframework_header, add_system_framework_path,
frameworks_in_use, num_frameworks, max_frameworks,
add_framework, find_framework, struct framework_header,
framework_header_dirs, framework_construct_pathname,
find_subframework_file, add_system_framework_path,
add_framework_path, framework_defaults,
darwin_register_frameworks, find_subframework_header): Add.
* config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New.
(TARGET_OPTION_TRANSLATE_TABLE): Add -framework support.
(CPP_SPEC): Add __APPLE_CC__ support.
* t-darwin (darwin-c.o): Add c-incpath.h dependency.
From-SVN: r78875
2004-03-04 01:18:54 +01:00
|
|
|
case OPT_F:
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
case OPT_I:
|
|
|
|
case OPT_idirafter:
|
|
|
|
case OPT_isysroot:
|
|
|
|
case OPT_isystem:
|
2004-05-05 14:20:33 +02:00
|
|
|
case OPT_iquote:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("missing path after %qs", opt);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
break;
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
case OPT_MF:
|
|
|
|
case OPT_MD:
|
|
|
|
case OPT_MMD:
|
2003-03-15 00:47:24 +01:00
|
|
|
case OPT_include:
|
|
|
|
case OPT_imacros:
|
2002-08-11 09:32:19 +02:00
|
|
|
case OPT_o:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("missing filename after %qs", opt);
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MQ:
|
|
|
|
case OPT_MT:
|
c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
testsuite:
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
From-SVN: r87413
2004-09-13 01:53:29 +02:00
|
|
|
error ("missing makefile target after %qs", opt);
|
2002-08-11 09:32:19 +02:00
|
|
|
break;
|
2002-08-09 08:19:08 +02:00
|
|
|
}
|
c-common.h (c_comon_handle_filename, [...]): New.
* c-common.h (c_comon_handle_filename,
c_common_missing_arguement): New.
* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
* c-opts.c (missing_arg): Rename c_common_missing_argument,
update to be an appropriate langhook.
(c_common_handle_option): Don't handle filenames.
(c_common_handle_filename): New.
* hooks.c (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* hooks.h (hook_void_constcharptr,
hook_bool_constcharptr_size_t_false): New.
* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): Add handle_filename and
missing_argument.
* opts.c (handle_option): Don't handle filenames here, but ...
(handle_options): ... here.
(common_handle_option): Don't handle missing arguments here.
* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): New.
ada:
* misc.c (gnat_handle_option): Don't handle filenames.
cp:
* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
LANG_HOOKS_MISSING_ARGUMENT): Override.
f:
* top.c (ffe_handle_option): Don't handle filenames.
java:
* lang.c (java_handle_option): Don't handle filenames.
From-SVN: r69011
2003-07-06 21:01:21 +02:00
|
|
|
|
|
|
|
return true;
|
2002-08-09 08:19:08 +02:00
|
|
|
}
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
/* Defer option CODE with argument ARG. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
defer_opt (enum opt_code code, const char *arg)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
{
|
|
|
|
deferred_opts[deferred_count].code = code;
|
|
|
|
deferred_opts[deferred_count].arg = arg;
|
|
|
|
deferred_count++;
|
|
|
|
}
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
/* Common initialization before parsing options. */
|
2003-07-02 22:15:46 +02:00
|
|
|
unsigned int
|
2004-10-12 00:57:53 +02:00
|
|
|
c_common_init_options (unsigned int argc, const char **argv)
|
2002-08-07 20:32:13 +02:00
|
|
|
{
|
2003-07-02 22:15:46 +02:00
|
|
|
static const unsigned int lang_flags[] = {CL_C, CL_ObjC, CL_CXX, CL_ObjCXX};
|
2004-10-12 00:57:53 +02:00
|
|
|
unsigned int i, result;
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
|
|
|
|
/* This is conditionalized only because that is the way the front
|
|
|
|
ends used to do it. Maybe this should be unconditional? */
|
|
|
|
if (c_dialect_cxx ())
|
|
|
|
{
|
|
|
|
/* By default wrap lines at 80 characters. Is getenv
|
|
|
|
("COLUMNS") preferable? */
|
|
|
|
diagnostic_line_cutoff (global_dc) = 80;
|
|
|
|
/* By default, emit location information once for every
|
|
|
|
diagnostic message. */
|
|
|
|
diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
parse_in = cpp_create_reader (c_dialect_cxx () ? CLK_GNUCXX: CLK_GNUC89,
|
2004-01-20 06:30:18 +01:00
|
|
|
ident_hash, &line_table);
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
cpp_opts = cpp_get_options (parse_in);
|
c-common.c, c-common.h (dollars_in_ident): Remove.
* c-common.c, c-common.h (dollars_in_ident): Remove.
* c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true.
(c_common_init_options, c_common_decode_option): Set dollars_in_ident.
* cpphash.h (warned_dollar): Rename warn_dollars.
* cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang)
Permit dollars regardless of -std=.
(post_options): Set warn_dollars.
* cpplex.c (forms_identifier_p): Use warn_dollars.
* config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h:
Remove redundant definitions of DOLLARS_IN_IDENTIFIERS.
* doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi:
Update documentation.
testsuite:
* gcc.dg/dollar.c: New test.
From-SVN: r66911
2003-05-17 22:29:34 +02:00
|
|
|
cpp_opts->dollars_in_ident = DOLLARS_IN_IDENTIFIERS;
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
cpp_opts->objc = c_dialect_objc ();
|
2003-06-12 08:09:15 +02:00
|
|
|
|
|
|
|
/* Reset to avoid warnings on internal definitions. We set it just
|
|
|
|
before passing on command-line options to cpplib. */
|
|
|
|
cpp_opts->warn_dollars = 0;
|
|
|
|
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
flag_exceptions = c_dialect_cxx ();
|
|
|
|
warn_pointer_arith = c_dialect_cxx ();
|
2006-02-13 02:57:29 +01:00
|
|
|
warn_write_strings = c_dialect_cxx();
|
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
|
|
|
|
2004-07-25 22:43:23 +02:00
|
|
|
deferred_opts = XNEWVEC (struct deferred_opt, argc);
|
2003-07-02 22:15:46 +02:00
|
|
|
|
2003-07-05 09:20:32 +02:00
|
|
|
result = lang_flags[c_language];
|
|
|
|
|
2004-10-12 00:57:53 +02:00
|
|
|
if (c_language == clk_c)
|
2003-07-05 09:20:32 +02:00
|
|
|
{
|
2004-10-12 00:57:53 +02:00
|
|
|
/* If preprocessing assembly language, accept any of the C-family
|
|
|
|
front end options since the driver may pass them through. */
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
if (! strcmp (argv[i], "-lang-asm"))
|
|
|
|
{
|
|
|
|
result |= CL_C | CL_ObjC | CL_CXX | CL_ObjCXX;
|
|
|
|
break;
|
|
|
|
}
|
2005-11-04 09:29:16 +01:00
|
|
|
|
|
|
|
#ifdef CL_Fortran
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
if (! strcmp (argv[i], "-lang-fortran"))
|
|
|
|
{
|
|
|
|
result |= CL_Fortran;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
2003-07-05 09:20:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2002-08-07 20:32:13 +02:00
|
|
|
}
|
|
|
|
|
2003-08-05 23:15:57 +02:00
|
|
|
/* Handle switch SCODE with argument ARG. VALUE is true, unless no-
|
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
|
|
|
form of an -f or -W option was given. Returns 0 if the switch was
|
|
|
|
invalid, a negative number to prevent language-independent
|
|
|
|
processing in toplev.c (a hack necessary for the short-term). */
|
2002-08-07 20:32:13 +02:00
|
|
|
int
|
2003-06-16 07:47:07 +02:00
|
|
|
c_common_handle_option (size_t scode, const char *arg, int value)
|
2002-08-07 20:32:13 +02: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
|
|
|
const struct cl_option *option = &cl_options[scode];
|
|
|
|
enum opt_code code = (enum opt_code) scode;
|
2003-06-25 22:43:11 +02:00
|
|
|
int result = 1;
|
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
|
|
|
|
2006-09-17 15:14:53 +02:00
|
|
|
/* Prevent resetting the language standard to a C dialect when the driver
|
|
|
|
has already determined that we're looking at assembler input. */
|
|
|
|
bool preprocessing_asm_p = (cpp_get_options (parse_in)->lang == CLK_ASM);
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
switch (code)
|
2002-08-07 20:32:13 +02: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
|
|
|
default:
|
c-common.h (warn_cast_qual, [...]): Remove explicit declarations.
* c-common.h (warn_cast_qual, warn_missing_format_attribute,
warn_pointer_arith, warn_missing_prototypes, warn_parentheses,
warn_missing_braces, warn_sign_compare, warn_long_long,
warn_redundant_decls, warn_float_equal, warn_char_subscripts,
warn_conversion, warn_format_y2k, warn_format_extra_args,
warn_format_zero_length, warn_format_nonliteral,
warn_format_security, mesg_implicit_function_declaration,
warn_bad_function_cast, warn_traditional,
warn_declaration_after_statement, warn_strict_prototypes,
warn_missing_declarations, warn_nested_externs,
warn_sequence_point, warn_init_self, warn_div_by_zero,
warn_implicit_int, warn_nonnull, warn_old_style_definition,
warn_selector, warn_undeclared_selector, warn_protocol,
warn_abi, warn_invalid_offsetof, warn_ctor_dtor_privacy,
warn_overloaded_virtual, warn_nonvdtor, warn_reorder,
warn_synth, warn_pmf2ptr, warn_ecpp, warn_sign_promo,
warn_old_style_cast, warn_nontemplate_friend,
warn_deprecated): Remove explicit declarations.
* c-common.c: Likewise, remove explicit definitions.
* c-opts.c: Likewise, remove explicit assignments.
* c.opts: Likewise, add implicit declare/define/assign.
From-SVN: r83680
2004-06-25 23:24:21 +02:00
|
|
|
if (cl_options[code].flags & (CL_C | CL_CXX | CL_ObjC | CL_ObjCXX))
|
|
|
|
break;
|
2005-11-04 09:29:16 +01:00
|
|
|
#ifdef CL_Fortran
|
|
|
|
if (lang_fortran && (cl_options[code].flags & (CL_Fortran)))
|
|
|
|
break;
|
|
|
|
#endif
|
2004-10-12 00:57:53 +02:00
|
|
|
result = 0;
|
2003-07-05 09:20:32 +02:00
|
|
|
break;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT__output_pch_:
|
2003-01-10 03:22:34 +01:00
|
|
|
pch_file = arg;
|
|
|
|
break;
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
case OPT_A:
|
|
|
|
defer_opt (code, arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_C:
|
|
|
|
cpp_opts->discard_comments = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_CC:
|
|
|
|
cpp_opts->discard_comments = 0;
|
|
|
|
cpp_opts->discard_comments_in_macro_exp = 0;
|
|
|
|
break;
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
case OPT_D:
|
|
|
|
defer_opt (code, arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_E:
|
|
|
|
flag_preprocess_only = 1;
|
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_H:
|
|
|
|
cpp_opts->print_include_names = 1;
|
|
|
|
break;
|
|
|
|
|
Add framework support for darwin.
* c-incpath.c: Include target.h and machmode.h.
(add_path): Use a consistent style for cpp_dir. Initialize
p->construct to 0.
(add_cpp_dir_path): New.
(register_include_chains): Add use of extra_includes callback.
(hook_void_int): Add.
(target_c_incpath): Add.
* c-incpath.h (add_cpp_dir_path): New.
(target_c_incpath_s): Add.
(target_c_incpath): Add.
(C_INCPATH_INIT): Add.
* c-opts.c (c_common_missing_argument,
c_common_handle_option): Add -F argument processing.
* c.opt: Add -F argument processing.
* gcc.c (trad_capable_cpp): Add -F argument processing.
* cppfiles.c (find_file_in_dir): Update to use construct
callback.
(search_path_exhausted, cpp_get_path, cpp_get_buffer,
cpp_get_prev): New.
(_cpp_find_file): Use search_path_exhausted.
(make_cpp_dir): Initialize construct to 0.
* cpplib.h (missing_header_cb
cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New.
(cpp_callbacks): Add missing_header
(cpp_dir): Add construct.
* target-def.h: (TARGET_OPTF): New.
* hooks.c (hook_void_int, hook_void_charptr): Add.
* hooks.h (hook_void_int, hook_void_charptr): Add.
* Makefile.in (c-incpath.o) : Add $(TARGET_H) and
$(MACHMODE_H) dependencies.
* doc/invoke.texi (Darwin Options): Document -F.
* doc/tm.texi (TARGET_EXTRA_INCLUDES): Add.
(TARGET_OPTF): Add.
* fix-header.c (target_c_incpath): Add.
* config/darwin-c.c: Add c-incpath.h include.
(using_frameworks, find_subframework_file,
find_subframework_header, add_system_framework_path,
frameworks_in_use, num_frameworks, max_frameworks,
add_framework, find_framework, struct framework_header,
framework_header_dirs, framework_construct_pathname,
find_subframework_file, add_system_framework_path,
add_framework_path, framework_defaults,
darwin_register_frameworks, find_subframework_header): Add.
* config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New.
(TARGET_OPTION_TRANSLATE_TABLE): Add -framework support.
(CPP_SPEC): Add __APPLE_CC__ support.
* t-darwin (darwin-c.o): Add c-incpath.h dependency.
From-SVN: r78875
2004-03-04 01:18:54 +01:00
|
|
|
case OPT_F:
|
|
|
|
TARGET_OPTF (xstrdup (arg));
|
|
|
|
break;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
case OPT_I:
|
|
|
|
if (strcmp (arg, "-"))
|
2004-05-22 04:39:35 +02:00
|
|
|
add_path (xstrdup (arg), BRACKET, 0, true);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (quote_chain_split)
|
|
|
|
error ("-I- specified twice");
|
|
|
|
quote_chain_split = true;
|
|
|
|
split_quote_chain ();
|
2004-05-05 14:20:33 +02:00
|
|
|
inform ("obsolete option -I- used, please use -iquote instead");
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
case OPT_M:
|
|
|
|
case OPT_MM:
|
|
|
|
/* When doing dependencies with -M or -MM, suppress normal
|
|
|
|
preprocessed output, but still do -dM etc. as software
|
|
|
|
depends on this. Preprocessed output does occur if -MD, -MMD
|
|
|
|
or environment var dependency generation is used. */
|
|
|
|
cpp_opts->deps.style = (code == OPT_M ? DEPS_SYSTEM: DEPS_USER);
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
flag_no_output = 1;
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
cpp_opts->inhibit_warnings = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MD:
|
|
|
|
case OPT_MMD:
|
|
|
|
cpp_opts->deps.style = (code == OPT_MD ? DEPS_SYSTEM: DEPS_USER);
|
|
|
|
deps_file = arg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MF:
|
|
|
|
deps_seen = true;
|
|
|
|
deps_file = arg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MG:
|
|
|
|
deps_seen = true;
|
|
|
|
cpp_opts->deps.missing_files = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MP:
|
|
|
|
deps_seen = true;
|
|
|
|
cpp_opts->deps.phony_targets = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_MQ:
|
|
|
|
case OPT_MT:
|
|
|
|
deps_seen = true;
|
|
|
|
defer_opt (code, arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_P:
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
flag_no_line_commands = 1;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
|
2003-08-05 23:15:57 +02:00
|
|
|
case OPT_fworking_directory:
|
|
|
|
flag_working_directory = value;
|
|
|
|
break;
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
case OPT_U:
|
|
|
|
defer_opt (code, arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wall:
|
2003-06-16 07:47:07 +02:00
|
|
|
set_Wunused (value);
|
|
|
|
set_Wformat (value);
|
|
|
|
set_Wimplicit (value);
|
|
|
|
warn_char_subscripts = value;
|
|
|
|
warn_missing_braces = value;
|
|
|
|
warn_parentheses = value;
|
|
|
|
warn_return_type = value;
|
|
|
|
warn_sequence_point = value; /* Was C only. */
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
if (c_dialect_cxx ())
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_sign_compare = value;
|
|
|
|
warn_switch = value;
|
|
|
|
warn_strict_aliasing = value;
|
2005-12-04 20:56:47 +01:00
|
|
|
warn_string_literal_comparison = value;
|
2005-12-14 00:33:26 +01:00
|
|
|
warn_always_true = value;
|
2007-01-18 14:00:33 +01:00
|
|
|
warn_array_bounds = value;
|
2003-06-22 15:41:26 +02:00
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
/* Only warn about unknown pragmas that are not in system
|
2003-06-22 15:41:26 +02:00
|
|
|
headers. */
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_unknown_pragmas = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
|
|
|
/* We save the value of warn_uninitialized, since if they put
|
|
|
|
-Wuninitialized on the command line, we need to generate a
|
|
|
|
warning about not using it without also specifying -O. */
|
|
|
|
if (warn_uninitialized != 1)
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_uninitialized = (value ? 2 : 0);
|
2002-08-07 20:32:13 +02:00
|
|
|
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
if (!c_dialect_cxx ())
|
2002-08-07 20:32:13 +02:00
|
|
|
/* We set this to 2 here, but 1 in -Wmain, so -ffreestanding
|
|
|
|
can turn it off only if it's not explicit. */
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_main = value * 2;
|
2002-08-07 20:32:13 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* C++-specific warnings. */
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_reorder = value;
|
|
|
|
warn_nontemplate_friend = value;
|
2007-01-25 05:04:18 +01:00
|
|
|
warn_cxx0x_compat = value;
|
2006-11-20 02:03:49 +01:00
|
|
|
if (value > 0)
|
|
|
|
warn_write_strings = true;
|
2002-08-07 20:32:13 +02:00
|
|
|
}
|
2002-08-08 08:30:13 +02:00
|
|
|
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_trigraphs = value;
|
|
|
|
cpp_opts->warn_comments = value;
|
|
|
|
cpp_opts->warn_num_sign_change = value;
|
|
|
|
cpp_opts->warn_multichar = value; /* Was C++ only. */
|
2006-01-26 19:50:37 +01:00
|
|
|
|
|
|
|
if (warn_pointer_sign == -1)
|
|
|
|
warn_pointer_sign = 1;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_Wcomment:
|
|
|
|
case OPT_Wcomments:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_comments = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wdeprecated:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_deprecated = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_Wendif_labels:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_endif_labels = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Werror:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warnings_are_errors = value;
|
2004-08-30 06:48:34 +02:00
|
|
|
global_dc->warning_as_error_requested = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_Werror_implicit_function_declaration:
|
2003-06-02 07:48:30 +02:00
|
|
|
mesg_implicit_function_declaration = 2;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Wformat:
|
2003-06-16 07:47:07 +02:00
|
|
|
set_Wformat (value);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_Wformat_:
|
2002-08-07 20:32:13 +02:00
|
|
|
set_Wformat (atoi (arg));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Wimplicit:
|
2003-06-16 07:47:07 +02:00
|
|
|
set_Wimplicit (value);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_Wimport:
|
2003-08-01 16:04:02 +02:00
|
|
|
/* Silently ignore for now. */
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2003-01-10 03:22:34 +01:00
|
|
|
case OPT_Winvalid_pch:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_invalid_pch = value;
|
2003-01-10 03:22:34 +01:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wmain:
|
2003-06-16 07:47:07 +02:00
|
|
|
if (value)
|
2002-08-07 20:32:13 +02:00
|
|
|
warn_main = 1;
|
|
|
|
else
|
|
|
|
warn_main = -1;
|
|
|
|
break;
|
|
|
|
|
2004-05-22 04:39:35 +02:00
|
|
|
case OPT_Wmissing_include_dirs:
|
|
|
|
cpp_opts->warn_missing_include_dirs = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wmultichar:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_multichar = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2005-03-15 01:36:33 +01:00
|
|
|
case OPT_Wnormalized_:
|
|
|
|
if (!value || (arg && strcasecmp (arg, "none") == 0))
|
|
|
|
cpp_opts->warn_normalize = normalized_none;
|
|
|
|
else if (!arg || strcasecmp (arg, "nfkc") == 0)
|
|
|
|
cpp_opts->warn_normalize = normalized_KC;
|
|
|
|
else if (strcasecmp (arg, "id") == 0)
|
|
|
|
cpp_opts->warn_normalize = normalized_identifier_C;
|
|
|
|
else if (strcasecmp (arg, "nfc") == 0)
|
|
|
|
cpp_opts->warn_normalize = normalized_C;
|
|
|
|
else
|
|
|
|
error ("argument %qs to %<-Wnormalized%> not recognized", arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wreturn_type:
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_return_type = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2005-05-02 06:22:45 +02:00
|
|
|
case OPT_Wstrict_null_sentinel:
|
|
|
|
warn_strict_null_sentinel = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_Wsystem_headers:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_system_headers = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wtraditional:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_traditional = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Wtrigraphs:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_trigraphs = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Wundef:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->warn_undef = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_Wunknown_pragmas:
|
|
|
|
/* Set to greater than 1, so that even unknown pragmas in
|
2003-06-22 15:41:26 +02:00
|
|
|
system headers will be warned about. */
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_unknown_pragmas = value * 2;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_Wunused_macros:
|
2003-06-16 07:47:07 +02:00
|
|
|
warn_unused_macros = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2004-02-19 23:18:50 +01:00
|
|
|
case OPT_Wvariadic_macros:
|
|
|
|
warn_variadic_macros = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_Wwrite_strings:
|
2006-02-09 17:28:26 +01:00
|
|
|
warn_write_strings = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
2003-06-22 15:41:26 +02:00
|
|
|
|
2006-01-22 03:38:03 +01:00
|
|
|
case OPT_Weffc__:
|
|
|
|
warn_ecpp = value;
|
|
|
|
if (value)
|
|
|
|
warn_nonvdtor = true;
|
|
|
|
break;
|
|
|
|
|
2002-08-10 22:58:45 +02:00
|
|
|
case OPT_ansi:
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
if (!c_dialect_cxx ())
|
2002-08-10 22:58:45 +02:00
|
|
|
set_std_c89 (false, true);
|
|
|
|
else
|
|
|
|
set_std_cxx98 (true);
|
|
|
|
break;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_d:
|
|
|
|
handle_OPT_d (arg);
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fcond_mismatch:
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
if (!c_dialect_cxx ())
|
2002-08-07 20:32:13 +02:00
|
|
|
{
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_cond_mismatch = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* Fall through. */
|
|
|
|
|
|
|
|
case OPT_fall_virtual:
|
2003-12-23 00:57:08 +01:00
|
|
|
case OPT_falt_external_templates:
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fenum_int_equiv:
|
2003-12-23 00:57:08 +01:00
|
|
|
case OPT_fexternal_templates:
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fguiding_decls:
|
|
|
|
case OPT_fhonor_std:
|
|
|
|
case OPT_fhuge_objects:
|
|
|
|
case OPT_flabels_ok:
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_fname_mangling_version_:
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fnew_abi:
|
|
|
|
case OPT_fnonnull_objects:
|
|
|
|
case OPT_fsquangle:
|
|
|
|
case OPT_fstrict_prototype:
|
|
|
|
case OPT_fthis_is_variable:
|
|
|
|
case OPT_fvtable_thunks:
|
|
|
|
case OPT_fxref:
|
2003-07-30 19:27:17 +02:00
|
|
|
case OPT_fvtable_gc:
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
warning (0, "switch %qs is no longer supported", option->opt_text);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_faccess_control:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_access_control = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fasm:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_no_asm = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fbuiltin:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_no_builtin = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fbuiltin_:
|
2003-06-16 07:47:07 +02:00
|
|
|
if (value)
|
2002-08-09 08:19:08 +02:00
|
|
|
result = 0;
|
|
|
|
else
|
|
|
|
disable_builtin_function (arg);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fdollars_in_identifiers:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->dollars_in_ident = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_ffreestanding:
|
2003-06-16 07:47:07 +02:00
|
|
|
value = !value;
|
2003-07-23 01:15:30 +02:00
|
|
|
/* Fall through.... */
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fhosted:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_hosted = value;
|
|
|
|
flag_no_builtin = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
/* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
|
2003-06-16 07:47:07 +02:00
|
|
|
if (!value && warn_main == 2)
|
2002-08-07 20:32:13 +02:00
|
|
|
warn_main = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fshort_double:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_short_double = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fshort_enums:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_short_enums = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fshort_wchar:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_short_wchar = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fsigned_bitfields:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_signed_bitfields = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fsigned_char:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_signed_char = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_funsigned_bitfields:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_signed_bitfields = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_funsigned_char:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_signed_char = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fcheck_new:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_check_new = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fconserve_space:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_conserve_space = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_fconstant_string_class_:
|
2002-08-09 08:19:08 +02:00
|
|
|
constant_string_class_name = arg;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fdefault_inline:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_default_inline = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_felide_constructors:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_elide_constructors = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fenforce_eh_specs:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_enforce_eh_specs = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
c.opt (fextended-identifiers): New.
gcc:
* c.opt (fextended-identifiers): New.
* c-opts.c (c_common_handle_option): Handle
-fextended-identifiers.
* doc/cpp.texi: Update documentation of extended identifiers.
* doc/cppopts.texi (-fextended-identifiers): Document.
gcc/testsuite:
* g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C,
g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c,
gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c,
gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c,
gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c,
gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c,
gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c,
gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers.
* gcc.dg/cpp/ucnid-8.c: New test.
libcpp:
* include/cpplib.h (struct cpp_options): Add extended_identifiers.
* init.c (struct lang_flags, lang_defaults): Add
extended_identifiers.
(cpp_set_lang): Use it.
* lex.c (forms_identifier_p): Check extended_identifiers.
From-SVN: r104462
2005-09-20 22:31:37 +02:00
|
|
|
case OPT_fextended_identifiers:
|
|
|
|
cpp_opts->extended_identifiers = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_ffor_scope:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_new_for_scope = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fgnu_keywords:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_no_gnu_keywords = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fgnu_runtime:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_next_runtime = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fhandle_exceptions:
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_exceptions = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fimplement_inlines:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_implement_inlines = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fimplicit_inline_templates:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_implicit_inline_templates = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fimplicit_templates:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_implicit_templates = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2007-01-08 10:25:07 +01:00
|
|
|
case OPT_flax_vector_conversions:
|
|
|
|
flag_lax_vector_conversions = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fms_extensions:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_ms_extensions = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fnext_runtime:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_next_runtime = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2003-09-25 03:26:01 +02:00
|
|
|
case OPT_fnil_receivers:
|
|
|
|
flag_nil_receivers = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fnonansi_builtins:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_no_nonansi_builtin = !value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_foperator_names:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->operator_names = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_foptional_diags:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_optional_diags = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2003-01-10 03:22:34 +01:00
|
|
|
case OPT_fpch_deps:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->restore_pch_deps = value;
|
2003-01-10 03:22:34 +01:00
|
|
|
break;
|
|
|
|
|
2004-06-22 08:51:56 +02:00
|
|
|
case OPT_fpch_preprocess:
|
|
|
|
flag_pch_preprocess = value;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fpermissive:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_permissive = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_fpreprocessed:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->preprocessed = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2003-09-25 03:26:01 +02:00
|
|
|
case OPT_freplace_objc_classes:
|
|
|
|
flag_replace_objc_classes = value;
|
|
|
|
break;
|
2006-05-19 00:16:23 +02:00
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_frepo:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_use_repository = value;
|
|
|
|
if (value)
|
2002-08-07 20:32:13 +02:00
|
|
|
flag_implicit_templates = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_frtti:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_rtti = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_fshow_column:
|
2003-06-16 07:47:07 +02:00
|
|
|
cpp_opts->show_column = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_fstats:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_detailed_statistics = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_ftabstop_:
|
2002-08-08 08:30:13 +02:00
|
|
|
/* It is documented that we silently ignore silly values. */
|
2003-06-16 07:47:07 +02:00
|
|
|
if (value >= 1 && value <= 100)
|
|
|
|
cpp_opts->tabstop = value;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
cpplib.h (CPP_AT_NAME, [...]): New token types.
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types.
(struct cpp_options): Add narrow_charset, wide_charset,
bytes_big_endian fields. Remove EBCDIC field.
(cpp_init_iconv, cpp_interpret_string): New external interfaces.
* cpphash.h: Include <iconv.h> if we have it, otherwise
provide a dummy definition of iconv_t.
(struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields.
(_cpp_valid_ucn): Update prototype.
(_cpp_destroy_iconv): New prototype.
* doc/cpp.texi: Document character set handling.
* doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=.
* doc/extend.texi: Delete entire section on multiline strings.
Rewrite section on __FUNCTION__ etc now that these are
variables in C.
* cppucnid.tab, cppucnid.pl: New files.
* cppucnid.h: New generated file.
* cppcharset.c: Include cppucnid.h. Lots of commentary added.
(iconv_open, iconv, iconv_close): Provide dummy definitions
if !HAVE_ICONV.
(SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv,
_cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn,
emit_numeric_escape, convert_hex, convert_oct, convert_escape,
cpp_interpret_string, narrow_str_to_charconst,
wide_str_to_charconst): New.
(ucn_valid_in_identifier): Use a binary search through the
ucnranges table defined in cppucnid.h, not a long chain of if
statements.
(_cpp_valid_ucn): Add a limit pointer. Downgrade "universal
character names are only valid in C++ and C99" to a warning.
Issue the "meaning of \[uU] is different in traditional C"
warning here. Take care not to let iconv see an invalid UCS
value if we get a malformed UCN. Issue an error if we don't
have iconv.
(cpp_interpret_charconst): Moved here from cpplex.c. Use
cpp_interpret_string to do the heavy lifting.
* cppinit.c (cpp_create_reader): Initialize bytes_big_endian,
narrow_charset, wide_charset fields of options structure.
(cpp_destroy): Call _cpp_destroy_iconv.
* cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn.
(maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete.
(cpp_interpret_charconst): Moved to cppcharset.c.
* cpplib.c (dequote_string): Delete.
(interpret_string_notranslate): New.
(do_line, do_linemarker): Use interpret_string_notranslate.
* Makefile.in (cppcharset.o): Depend on cppucnid.h.
* c-common.c (fname_string, combine_strings): Delete.
* c-common.h (fname_string, combine_strings): Delete prototypes.
* c-lex.c (ignore_escape_flag): Delete.
(cb_ident): Use cpp_interpret_string, not lex_string.
(get_nonpadding_token): New function.
(c_lex): Handle Objective-C @-prefixed identifiers and strings here.
Adjust calls to lex_string. Don't write *value twice.
(lex_string): Now handles string constant concatenation.
Most of the work handed off to cpp_interpret_string.
Call fix_string_type here.
* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with
FUNC_NAME, throughout.
(OBJC_STRING): New token type.
(primary:STRING): No need to call fix_string_type here.
(primary:objc_string): Make that OBJC_STRING.
(objc_string nonterminal): Delete.
(yylexname): Delete code to handle fake string constants.
(yylexstring): Delete entirely.
(_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need
to handle CPP_ATSIGN.
* c.opt (-fexec-charset=, -fwide-exec-charset=): New options.
* c-opts.c (missing_arg, c_common_handle_option): Handle
OPT_fexec_charset_ and OPT_fwide_exec_charset_.
(c_common_init): Set cpp_opts->bytes_big_endian, not
cpp_opts->EBCDIC. Call cpp_init_iconv.
(print_help): Document -fexec-charset= and -fexec-wide-charset=.
(TARGET_EBCDIC): Delete default definition.
* objc/objc-act.c (build_objc_string_object): No need to
handle string constant concatenation.
cp:
* parser.c (cp_lexer_read_token): No need to handle string
constant concatenation.
testsuite:
* gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c
everywhere.
* gcc.dg/concat.c: Concatenation of string constants with
__FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error.
* gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp.
* gcc.dg/cpp/escape-2.c: Use wide character constants where
necessary to avoid multi-character character constant warning.
* gcc.dg/cpp/escape.c: Likewise.
* gcc.dg/cpp/ucs.c: Likewise.
Remove backslashes from dg-bogus comments, as they confuse Tcl.
Fix a typo.
libstdc++-v3:
* testsuite/22_locale/collate/compare/wchar_t/2.cc
* testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
* testsuite/22_locale/collate/hash/wchar_t/2.cc
* testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
* testsuite/22_locale/collate/transform/wchar_t/2.cc
* testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
XFAIL on all targets.
From-SVN: r68952
2003-07-05 02:24:00 +02:00
|
|
|
case OPT_fexec_charset_:
|
|
|
|
cpp_opts->narrow_charset = arg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fwide_exec_charset_:
|
|
|
|
cpp_opts->wide_charset = arg;
|
|
|
|
break;
|
|
|
|
|
2004-02-02 21:20:58 +01:00
|
|
|
case OPT_finput_charset_:
|
|
|
|
cpp_opts->input_charset = arg;
|
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_ftemplate_depth_:
|
2003-06-16 07:47:07 +02:00
|
|
|
max_tinst_depth = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_fuse_cxa_atexit:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_use_cxa_atexit = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
2006-11-01 17:29:06 +01:00
|
|
|
|
2006-02-24 22:43:01 +01:00
|
|
|
case OPT_fuse_cxa_get_exception_ptr:
|
|
|
|
flag_use_cxa_get_exception_ptr = value;
|
|
|
|
break;
|
2006-05-19 00:16:23 +02:00
|
|
|
|
re PR c++/9283 (__attribute__((visibility ("hidden"))) not supported for class/struct)
PR c++/9283
PR c++/15000
* c-common.c (c_common_attribute_table): Allow
handle_visibility_attribute to be called for types.
(handle_visibility_attribute) When given a type, set the visibility
bits on the TYPE_NAME. When given a decl, don't set no_add_attrs
so that we can check later whether the attribute was present. Added
warning if attribute applied to non class type.
* c-decl.c (diagnose_mismatched_decls): Updated rules for merging
decls and checking that they are consistent.
* common.opt: Added -fvisibility.
* c.opt, c-opts.c: Added -fvisibility-inlines-hidden.
* c-pragma.h, c-pragma.c: Added handle_pragma_visibility().
* flags.h, tree.h: Added assorted support defines for overall patch
* opts.c: Added parsing support for -fvisibility.
* tree.c (build_decl): Set visibility for all decls to be whatever
is in force at that time.
* varasm.c (default_binds_local_p_1): Reworked logic determining
when to make a symbol locally bound.
* doc/invoke.texi: Added documentation for -fvisibility and
-fvisibility-inlines-hidden.
PR c++/15000
PR c++/9283
* class.c (check_field_decls): Apply hidden visibility if
-fvisibility-inlines-hidden and inlined unless otherwise specified
(build_vtable): Set vtable visibility to class visibility.
(check_field_decls): Default static member visibility to class
visibility.
(check_methods): Default method visibility to class visibility.
* cp-tree.h: Added CLASSTYPE_VISIBILITY and
CLASSTYPE_VISIBILITY_SPECIFIED macro.
* decl.c (duplicate_decls): New logic for merging definition decls
with declaration decls. Added ignore & warning when non default
applied to global operator new or delete.
* method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
wherever VISIBILITY was changed
* rtti.c (get_tinfo_decl): Set typeinfo visibility to class
visibility.
(tinfo_base_init): Set typeinfo name visibility to class visibility.
PR c++/9283
PR c++/15000
* gcc.dg/visibility-9.c, gcc.dg/visibility-a.c: New tests.
* g++.dg/ext/visibility/: New directory.
* g++.dg/ext/visibility-1.C, g++.dg/ext/visibility-2.C
g++.dg/ext/visibility-3.C, g++.dg/ext/visibility-4.C,
g++.dg/ext/visibility-5.C, g++.dg/ext/visibility-6.C,
g++.dg/ext/visibility-7.C: Move to g++.dg/ext/visibility/.
* g++.dg/ext/visibility/fvisibility.C,
g++.dg/ext/visibility/fvisibility-inlines-hidden.C,
g++.dg/ext/visibility/fvisibility-override1.C
g++.dg/ext/visibility/fvisibility-override2.C
g++.dg/ext/visibility/memfuncts.C
g++.dg/ext/visibility/noPLT.C
g++.dg/ext/visibility/pragma.C
g++.dg/ext/visibility/pragma-override1.C
g++.dg/ext/visibility/pragma-override2.C
g++.dg/ext/visibility/staticmemfuncts.C
g++.dg/ext/visibility/virtual.C: New tests.
Co-Authored-By: Brian Ryner <bryner@brianryner.com>
From-SVN: r85167
2004-07-26 00:52:22 +02:00
|
|
|
case OPT_fvisibility_inlines_hidden:
|
|
|
|
visibility_options.inlines_hidden = value;
|
|
|
|
break;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
|
|
|
case OPT_fweak:
|
2003-06-16 07:47:07 +02:00
|
|
|
flag_weak = value;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
2003-09-25 03:26:01 +02:00
|
|
|
|
2004-08-28 04:33:54 +02:00
|
|
|
case OPT_fthreadsafe_statics:
|
|
|
|
flag_threadsafe_statics = value;
|
|
|
|
break;
|
|
|
|
|
2003-09-25 03:26:01 +02:00
|
|
|
case OPT_fzero_link:
|
|
|
|
flag_zero_link = value;
|
|
|
|
break;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
|
|
|
case OPT_gen_decls:
|
|
|
|
flag_gen_declaration = 1;
|
|
|
|
break;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
case OPT_idirafter:
|
2004-05-22 04:39:35 +02:00
|
|
|
add_path (xstrdup (arg), AFTER, 0, true);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
break;
|
|
|
|
|
2003-03-15 00:47:24 +01:00
|
|
|
case OPT_imacros:
|
2003-03-14 22:47:50 +01:00
|
|
|
case OPT_include:
|
|
|
|
defer_opt (code, arg);
|
|
|
|
break;
|
|
|
|
|
2006-01-20 22:00:03 +01:00
|
|
|
case OPT_imultilib:
|
|
|
|
imultilib = arg;
|
|
|
|
break;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
case OPT_iprefix:
|
|
|
|
iprefix = arg;
|
|
|
|
break;
|
|
|
|
|
2004-05-05 14:20:33 +02:00
|
|
|
case OPT_iquote:
|
2004-05-22 04:39:35 +02:00
|
|
|
add_path (xstrdup (arg), QUOTE, 0, true);
|
2004-05-05 14:20:33 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
case OPT_isysroot:
|
|
|
|
sysroot = arg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_isystem:
|
2004-05-22 04:39:35 +02:00
|
|
|
add_path (xstrdup (arg), SYSTEM, 0, true);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_iwithprefix:
|
|
|
|
add_prefixed_path (arg, SYSTEM);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_iwithprefixbefore:
|
|
|
|
add_prefixed_path (arg, BRACKET);
|
|
|
|
break;
|
|
|
|
|
2002-08-10 22:58:45 +02:00
|
|
|
case OPT_lang_asm:
|
|
|
|
cpp_set_lang (parse_in, CLK_ASM);
|
2003-05-20 00:15:57 +02:00
|
|
|
cpp_opts->dollars_in_ident = false;
|
2002-08-10 22:58:45 +02:00
|
|
|
break;
|
|
|
|
|
2005-11-04 09:29:16 +01:00
|
|
|
case OPT_lang_fortran:
|
|
|
|
lang_fortran = true;
|
|
|
|
break;
|
|
|
|
|
2002-08-10 22:58:45 +02:00
|
|
|
case OPT_lang_objc:
|
|
|
|
cpp_opts->objc = 1;
|
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_nostdinc:
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
std_inc = false;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_nostdinc__:
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
std_cxx_inc = false;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-11 09:32:19 +02:00
|
|
|
case OPT_o:
|
2002-08-12 00:22:28 +02:00
|
|
|
if (!out_fname)
|
|
|
|
out_fname = arg;
|
2002-08-11 09:32:19 +02:00
|
|
|
else
|
2003-06-03 07:42:25 +02:00
|
|
|
error ("output filename specified twice");
|
2002-08-11 09:32:19 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-08 08:30:13 +02:00
|
|
|
/* We need to handle the -pedantic switches here, rather than in
|
|
|
|
c_common_post_options, so that a subsequent -Wno-endif-labels
|
|
|
|
is not overridden. */
|
|
|
|
case OPT_pedantic_errors:
|
|
|
|
cpp_opts->pedantic_errors = 1;
|
2003-07-23 01:15:30 +02:00
|
|
|
/* Fall through. */
|
2002-08-08 08:30:13 +02:00
|
|
|
case OPT_pedantic:
|
|
|
|
cpp_opts->pedantic = 1;
|
|
|
|
cpp_opts->warn_endif_labels = 1;
|
2006-01-26 19:50:37 +01:00
|
|
|
if (warn_pointer_sign == -1)
|
|
|
|
warn_pointer_sign = 1;
|
2006-01-29 04:30:47 +01:00
|
|
|
if (warn_overlength_strings == -1)
|
|
|
|
warn_overlength_strings = 1;
|
2002-08-08 08:30:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_print_objc_runtime_info:
|
|
|
|
print_struct_values = 1;
|
|
|
|
break;
|
|
|
|
|
2005-05-18 22:45:26 +02:00
|
|
|
case OPT_print_pch_checksum:
|
|
|
|
c_common_print_pch_checksum (stdout);
|
|
|
|
exit_after_options = true;
|
|
|
|
break;
|
|
|
|
|
2002-08-11 09:32:19 +02:00
|
|
|
case OPT_remap:
|
|
|
|
cpp_opts->remap = 1;
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
Makefile.in (c-opts.o, [...]): Update dependencies.
* Makefile.in (c-opts.o, c-options.h): Update dependencies.
* c-opts.c: Include c-options.h and c-options.c.
(CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY):
Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX.
(CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option,
OPT, opt_comp): Remove.
(missing_arg, c_common_init_options, c_common_decode_option,
write_langs): Update for macro redefinitions and enumeration
name changes.
* c.opt, opts.sh: New files.
* doc/passes.texi: Update.
From-SVN: r67278
2003-05-31 23:18:21 +02:00
|
|
|
case OPT_std_c__98:
|
|
|
|
case OPT_std_gnu__98:
|
2006-09-17 15:14:53 +02:00
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_cxx98 (code == OPT_std_c__98 /* ISO */);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2006-11-01 17:29:06 +01:00
|
|
|
case OPT_std_c__0x:
|
|
|
|
case OPT_std_gnu__0x:
|
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_cxx0x (code == OPT_std_c__0x /* ISO */);
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_std_c89:
|
|
|
|
case OPT_std_iso9899_1990:
|
2002-08-11 09:32:19 +02:00
|
|
|
case OPT_std_iso9899_199409:
|
2006-09-17 15:14:53 +02:00
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */);
|
2002-08-10 22:58:45 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_std_gnu89:
|
2006-09-17 15:14:53 +02:00
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_c89 (false /* c94 */, false /* ISO */);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_std_c99:
|
|
|
|
case OPT_std_c9x:
|
|
|
|
case OPT_std_iso9899_1999:
|
|
|
|
case OPT_std_iso9899_199x:
|
2006-09-17 15:14:53 +02:00
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_c99 (true /* ISO */);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_std_gnu99:
|
|
|
|
case OPT_std_gnu9x:
|
2006-09-17 15:14:53 +02:00
|
|
|
if (!preprocessing_asm_p)
|
|
|
|
set_std_c99 (false /* ISO */);
|
2002-08-07 20:32:13 +02:00
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_trigraphs:
|
|
|
|
cpp_opts->trigraphs = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_traditional_cpp:
|
|
|
|
cpp_opts->traditional = 1;
|
|
|
|
break;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
case OPT_undef:
|
|
|
|
flag_undef = 1;
|
|
|
|
break;
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
case OPT_w:
|
|
|
|
cpp_opts->inhibit_warnings = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_v:
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
verbose = true;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
}
|
2002-08-07 20:32:13 +02:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Post-switch processing. */
|
|
|
|
bool
|
2004-02-05 07:52:26 +01:00
|
|
|
c_common_post_options (const char **pfilename)
|
2002-08-07 20:32:13 +02:00
|
|
|
{
|
2004-02-05 07:52:26 +01:00
|
|
|
struct cpp_callbacks *cb;
|
|
|
|
|
2002-08-12 08:02:53 +02:00
|
|
|
/* Canonicalize the input and output filenames. */
|
2003-07-11 10:33:21 +02:00
|
|
|
if (in_fnames == NULL)
|
|
|
|
{
|
2004-07-25 22:43:23 +02:00
|
|
|
in_fnames = XNEWVEC (const char *, 1);
|
2003-07-11 10:33:21 +02:00
|
|
|
in_fnames[0] = "";
|
|
|
|
}
|
|
|
|
else if (strcmp (in_fnames[0], "-") == 0)
|
|
|
|
in_fnames[0] = "";
|
2002-08-12 08:02:53 +02:00
|
|
|
|
2002-08-12 00:22:28 +02:00
|
|
|
if (out_fname == NULL || !strcmp (out_fname, "-"))
|
|
|
|
out_fname = "";
|
|
|
|
|
2002-08-14 19:19:28 +02:00
|
|
|
if (cpp_opts->deps.style == DEPS_NONE)
|
2002-08-12 00:22:28 +02:00
|
|
|
check_deps_environment_vars ();
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
handle_deferred_opts ();
|
2002-08-12 00:22:28 +02:00
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
sanitize_cpp_opts ();
|
2002-08-12 08:02:53 +02:00
|
|
|
|
2006-01-20 22:00:03 +01:00
|
|
|
register_include_chains (parse_in, sysroot, iprefix, imultilib,
|
c-common.c (enum c_language_kind, flag_objc): Remove.
* c-common.c (enum c_language_kind, flag_objc): Remove.
(fix_string_type, check_case_value, c_common_nodes_and_builtins,
c_add_case_label, finish_label_addr_expr, boolean_increment):
Use c_dialect_ macros.
* c-common.h (enum c_language_kind): Extend.
(c_dialect_cxx, c_dialect_objc): New.
(flag_objc): Remove.
(c_common_init_options): Update prototype.
* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
macros.
* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
macros.
* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
* c-lang.c (c_init_options): Remove.
(c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* c-lex.c (lex_charconst): Use c_dialect_cxx().
* c-opts.c (lang_flags): Make function-local.
(c_common_init_options): Use c_dialect_ macros. Handle
C++ diagnostic requirements.
(c_common_handle_option, c_common_post_options): Use flag_cxx.
* c-parse.in (init_reswords): Use c_dialect_objc ().
* c-pch.c (get_ident): Use c_language.
* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
* c-typeck.c (comptypes, build_c_cast): Similarly.
* objc/objc-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
(objc_init_options): Remove.
cp:
* Make-lang.in: Update.
* cp-lang.c (c_language): Define.
(LANG_HOOKS_INIT_OPTIONS): Use common hook.
* cp-tree.h (cxx_init_options): Remove.
* lex.c: Don't include diagnostic.h.
(cxx_init_options): Remove.
From-SVN: r68734
2003-06-30 21:36:25 +02:00
|
|
|
std_inc, std_cxx_inc && c_dialect_cxx (), verbose);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
|
2006-02-24 22:43:01 +01:00
|
|
|
#ifdef C_COMMON_OVERRIDE_OPTIONS
|
|
|
|
/* Some machines may reject certain combinations of C
|
|
|
|
language-specific options. */
|
|
|
|
C_COMMON_OVERRIDE_OPTIONS;
|
|
|
|
#endif
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
flag_inline_trees = 1;
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Use tree inlining. */
|
|
|
|
if (!flag_no_inline)
|
|
|
|
flag_no_inline = 1;
|
|
|
|
if (flag_inline_functions)
|
2004-11-24 20:45:32 +01:00
|
|
|
flag_inline_trees = 2;
|
2002-08-07 20:32:13 +02:00
|
|
|
|
2004-07-09 23:30:35 +02:00
|
|
|
/* If we are given more than one input file, we must use
|
|
|
|
unit-at-a-time mode. */
|
|
|
|
if (num_in_fnames > 1)
|
|
|
|
flag_unit_at_a_time = 1;
|
|
|
|
|
c-common.c (flag_objc_sjlj_exceptions): New.
* c-common.c (flag_objc_sjlj_exceptions): New.
* c-common.h (flag_objc_sjlj_exceptions): Declare.
* c-opts.c (c_common_handle_option): Set it.
(c_common_post_options): Handle interation of different
objective-c exception and runtime switches.
* c-decl.c (c_eh_initialized_p): New.
(finish_decl): Use it instead of local eh_initialized_p.
* c-parse.in (nested_function, notype_nested_function): Record
the result of compstmt.
(compstmt_or_error): Likewise.
(compstmt): Don't add_stmt the result.
(stmt): Don't return anything. Rewrite objc try and sync rules.
(objc_try_stmt, objc_catch_list): Remove.
(objc_catch_block, objc_finally_block): Remove.
(objc_catch_prefix, objc_catch_clause, objc_opt_catch_list): New.
(objc_try_catch_clause, objc_finally_clause): New.
(objc_try_catch_stmt): Rewrite.
* c-tree.h (c_eh_initialized_p): Declare.
* c-opt (fobjc-sjlj-exceptions): New.
* except.c (output_function_exception_table): Don't call cgraph
on non-decls.
* objc/objc-act.c (UTAG_EXCDATA_VAR, UTAG_CAUGHTEXC_VAR,
UTAG_RETHROWEXC_VAR, UTAG_EVALONCE_VAR, struct val_stack,
catch_count_stack, exc_binding_stack, if_nesting_count,
blk_nesting_count, objc_enter_block, objc_exit_block,
objc_declare_variable, val_stack_push, val_stack_pop,
objc_build_try_enter_fragment, objc_build_extract_expr,
objc_build_try_exit_fragment, objc_build_extract_fragment,
objc_build_try_prologue, objc_build_try_epilogue,
objc_build_catch_stmt, objc_build_catch_epilogue,
objc_build_finally_prologue, objc_build_finally_epilogue,
objc_build_try_catch_finally_stmt, objc_build_synchronized_prologue,
objc_build_synchronized_epilogue): Remove.
(objc_create_temporary_var, struct objc_try_context, cur_try_context,
objc_eh_runtime_type, objc_init_exceptions, objc_build_exc_ptr,
next_sjlj_build_try_exit, next_sjlj_build_enter_and_setjmp,
next_sjlj_build_exc_extract, next_sjlj_build_catch_list,
next_sjlj_build_try_catch_finally, objc_begin_try_stmt,
objc_begin_catch_clause, objc_finish_catch_clause,
objc_build_finally_clause, objc_finish_try_stmt,
objc_build_synchronized): New.
(objc_is_object_id, objc_is_class_id): New.
(objc_comptypes): Use them.
(build_next_objc_exception_stuff): Break NeXT sjlj out from
build_objc_exception_stuff.
(synth_module_prologue): Update to match.
(objc_build_throw_stmt): Use cur_try_context to decide if
we're in a @catch.
* objc/objc-act.h: Update prototypes.
(OCTI_EXCEPTION_BLK_STACK, objc_exception_block_stack): Remove.
testsuite/
* objc.dg/sync-1.m: New.
* objc.dg/try-catch-1.m: Don't force next runtime.
* objc.dg/try-catch-3.m, objc.dg/try-catch-4.m: Likewise.
* objc.dg/try-catch-2.m: Likewise. Enable everywhere. Remove
shadowed catch clause.
* objc.dg/try-catch-5.m: New.
From-SVN: r83332
2004-06-18 03:20:53 +02:00
|
|
|
/* Default to ObjC sjlj exception handling if NeXT runtime. */
|
|
|
|
if (flag_objc_sjlj_exceptions < 0)
|
|
|
|
flag_objc_sjlj_exceptions = flag_next_runtime;
|
|
|
|
if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
|
|
|
|
flag_exceptions = 1;
|
|
|
|
|
2006-12-22 16:54:05 +01:00
|
|
|
/* -Wextra implies -Wclobbered, -Wempty-body, -Wsign-compare,
|
2007-01-02 18:33:25 +01:00
|
|
|
-Wmissing-field-initializers, -Wmissing-parameter-type
|
|
|
|
-Wold-style-declaration, and -Woverride-init,
|
2006-12-16 17:48:01 +01:00
|
|
|
but not if explicitly overridden. */
|
2006-12-22 16:54:05 +01:00
|
|
|
if (warn_clobbered == -1)
|
|
|
|
warn_clobbered = extra_warnings;
|
2006-12-16 17:48:01 +01:00
|
|
|
if (warn_empty_body == -1)
|
|
|
|
warn_empty_body = extra_warnings;
|
2003-05-03 23:44:31 +02:00
|
|
|
if (warn_sign_compare == -1)
|
|
|
|
warn_sign_compare = extra_warnings;
|
2004-08-06 13:23:23 +02:00
|
|
|
if (warn_missing_field_initializers == -1)
|
|
|
|
warn_missing_field_initializers = extra_warnings;
|
2006-12-23 18:45:33 +01:00
|
|
|
if (warn_missing_parameter_type == -1)
|
|
|
|
warn_missing_parameter_type = extra_warnings;
|
2007-01-02 18:33:25 +01:00
|
|
|
if (warn_old_style_declaration == -1)
|
|
|
|
warn_old_style_declaration = extra_warnings;
|
2006-09-30 21:46:06 +02:00
|
|
|
if (warn_override_init == -1)
|
|
|
|
warn_override_init = extra_warnings;
|
2003-05-03 23:44:31 +02:00
|
|
|
|
2006-01-26 19:50:37 +01:00
|
|
|
/* -Wpointer_sign is disabled by default, but it is enabled if any
|
|
|
|
of -Wall or -pedantic are given. */
|
|
|
|
if (warn_pointer_sign == -1)
|
|
|
|
warn_pointer_sign = 0;
|
|
|
|
|
2006-01-29 04:30:47 +01:00
|
|
|
/* -Woverlength-strings is off by default, but is enabled by -pedantic.
|
|
|
|
It is never enabled in C++, as the minimum limit is not normative
|
|
|
|
in that standard. */
|
|
|
|
if (warn_overlength_strings == -1 || c_dialect_cxx ())
|
|
|
|
warn_overlength_strings = 0;
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
/* Special format checking options don't work without -Wformat; warn if
|
|
|
|
they are used. */
|
2005-05-25 05:59:00 +02:00
|
|
|
if (!warn_format)
|
|
|
|
{
|
|
|
|
warning (OPT_Wformat_y2k,
|
|
|
|
"-Wformat-y2k ignored without -Wformat");
|
|
|
|
warning (OPT_Wformat_extra_args,
|
|
|
|
"-Wformat-extra-args ignored without -Wformat");
|
|
|
|
warning (OPT_Wformat_zero_length,
|
|
|
|
"-Wformat-zero-length ignored without -Wformat");
|
|
|
|
warning (OPT_Wformat_nonliteral,
|
|
|
|
"-Wformat-nonliteral ignored without -Wformat");
|
|
|
|
warning (OPT_Wformat_security,
|
|
|
|
"-Wformat-security ignored without -Wformat");
|
|
|
|
}
|
2002-08-07 20:32:13 +02:00
|
|
|
|
2005-02-24 10:24:17 +01:00
|
|
|
/* C99 requires special handling of complex multiplication and division;
|
|
|
|
-ffast-math and -fcx-limited-range are handled in process_options. */
|
|
|
|
if (flag_isoc99)
|
|
|
|
flag_complex_method = 2;
|
|
|
|
|
2002-08-12 08:02:53 +02:00
|
|
|
if (flag_preprocess_only)
|
|
|
|
{
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
/* Open the output now. We must do so even if flag_no_output is
|
|
|
|
on, because there may be other output than from the actual
|
|
|
|
preprocessing (e.g. from -dM). */
|
|
|
|
if (out_fname[0] == '\0')
|
|
|
|
out_stream = stdout;
|
|
|
|
else
|
|
|
|
out_stream = fopen (out_fname, "w");
|
|
|
|
|
|
|
|
if (out_stream == NULL)
|
2003-03-07 00:12:30 +01:00
|
|
|
{
|
diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
(output_printf, output_verbatim, diagnostic_set_info,
verbatim): Set err_no field of the text_info structure being
initialized.
(fatal_io_error): Delete function.
* diagnostic.h (text_info): Add err_no field.
* toplev.h (fatal_io_error): Delete prototype.
* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
* objc/objc-act.c: Replace all calls to fatal_io_error with
calls to fatal_error; add ": %m" to the end of all the affected
error messages.
From-SVN: r66769
2003-05-13 20:06:52 +02:00
|
|
|
fatal_error ("opening output file %s: %m", out_fname);
|
2003-03-09 00:46:46 +01:00
|
|
|
return false;
|
2003-03-07 00:12:30 +01:00
|
|
|
}
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
|
2003-07-11 10:33:21 +02:00
|
|
|
if (num_in_fnames > 1)
|
|
|
|
error ("too many filenames given. Type %s --help for usage",
|
|
|
|
progname);
|
|
|
|
|
2003-03-07 00:12:30 +01:00
|
|
|
init_pp_output (out_stream);
|
2002-08-12 08:02:53 +02:00
|
|
|
}
|
2003-03-07 00:12:30 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
init_c_lex ();
|
2002-08-12 08:02:53 +02:00
|
|
|
|
2003-03-07 00:12:30 +01:00
|
|
|
/* Yuk. WTF is this? I do know ObjC relies on it somewhere. */
|
2004-06-30 20:05:07 +02:00
|
|
|
input_location = UNKNOWN_LOCATION;
|
2003-03-07 00:12:30 +01:00
|
|
|
}
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
|
2004-02-05 07:52:26 +01:00
|
|
|
cb = cpp_get_callbacks (parse_in);
|
|
|
|
cb->file_change = cb_file_change;
|
|
|
|
cb->dir_change = cb_dir_change;
|
2003-08-10 00:14:07 +02:00
|
|
|
cpp_post_options (parse_in);
|
2003-03-14 22:47:50 +01:00
|
|
|
|
2004-06-30 20:05:07 +02:00
|
|
|
input_location = UNKNOWN_LOCATION;
|
c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
2003-03-08 22:12:26 +01:00
|
|
|
|
|
|
|
/* If an error has occurred in cpplib, note it so we fail
|
|
|
|
immediately. */
|
|
|
|
errorcount += cpp_errors (parse_in);
|
|
|
|
|
2004-02-05 07:52:26 +01:00
|
|
|
*pfilename = this_input_filename
|
|
|
|
= cpp_read_main_file (parse_in, in_fnames[0]);
|
2004-04-14 08:07:27 +02:00
|
|
|
/* Don't do any compilation or preprocessing if there is no input file. */
|
2004-02-05 07:52:26 +01:00
|
|
|
if (this_input_filename == NULL)
|
2004-04-14 08:07:27 +02:00
|
|
|
{
|
|
|
|
errorcount++;
|
|
|
|
return false;
|
|
|
|
}
|
2004-02-05 07:52:26 +01:00
|
|
|
|
2004-02-10 19:18:57 +01:00
|
|
|
if (flag_working_directory
|
c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
code formatting conventions.
From-SVN: r88462
2004-10-03 22:53:05 +02:00
|
|
|
&& flag_preprocess_only && !flag_no_line_commands)
|
2004-02-05 07:52:26 +01:00
|
|
|
pp_dir_change (parse_in, get_src_pwd ());
|
|
|
|
|
c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
2003-03-08 22:12:26 +01:00
|
|
|
return flag_preprocess_only;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Front end initialization common to C, ObjC and C++. */
|
|
|
|
bool
|
2003-06-22 15:41:26 +02:00
|
|
|
c_common_init (void)
|
c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
2003-03-08 22:12:26 +01:00
|
|
|
{
|
|
|
|
/* Set up preprocessor arithmetic. Must be done after call to
|
|
|
|
c_common_nodes_and_builtins for type nodes to be good. */
|
|
|
|
cpp_opts->precision = TYPE_PRECISION (intmax_type_node);
|
|
|
|
cpp_opts->char_precision = TYPE_PRECISION (char_type_node);
|
|
|
|
cpp_opts->int_precision = TYPE_PRECISION (integer_type_node);
|
|
|
|
cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node);
|
builtins.c, [...]: Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:
Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise.
* calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise.
* expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise.
* optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise.
* tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise.
* config/mips/mips.c, config/rs6000/rs6000.c: Likewise.
* config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise.
* stor-layout.c (layout_type, case COMPLEX_TYPE): Test for
REAL_TYPE, not INTEGER_TYPE.
(layout_type, case VECTOR_TYPE): Simplify code.
* tree.c (build_vector_type_for_mode): Remove dup unsigned setting.
* tree.h: Update comments.
(STRIP_NOPS): Use TYPE_UNSIGNED.
(TYPE_UNSIGNED): New macro.
(TYPE_TRAP_SIGNED): Remove now redundant check.
(SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED.
* cp/call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* cp/class.c (check_bitfield_decl): Likewise.
* cp/cvt.c (type_promotes_to): Likewise.
* cp/decl.c (finish_enum): Likewise.
* cp/mangle.c (write_builtin_type): Likewise.
* cp/semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
* cp/typeck.c (type_after_usual_arithmetic_conversions): Likewise.
(build_binary_op): Likewise.
* f/com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
(ffecom_expr_): Likewise.
* java/jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.
* treelang/treetree.c (tree_lang_signed_or_unsigned_type):
Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* ada/decl.c (gnat_to_gnu_entity, make_type_from_size):
Use TYPE_UNSIGNED, not TREE_UNSIGNED.
* ada/trans.c (tree_transform, convert_with_check): Likewise.
* ada/utils.c (gnat_signed_or_unsigned_type): Likewise.
(build_vms_descriptor, unchecked_convert): Likewise.
* ada/utils2.c (nonbinary_modular_operation): Likewise.
From-SVN: r80287
2004-04-01 05:50:43 +02:00
|
|
|
cpp_opts->unsigned_wchar = TYPE_UNSIGNED (wchar_type_node);
|
cpplib.h (CPP_AT_NAME, [...]): New token types.
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types.
(struct cpp_options): Add narrow_charset, wide_charset,
bytes_big_endian fields. Remove EBCDIC field.
(cpp_init_iconv, cpp_interpret_string): New external interfaces.
* cpphash.h: Include <iconv.h> if we have it, otherwise
provide a dummy definition of iconv_t.
(struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields.
(_cpp_valid_ucn): Update prototype.
(_cpp_destroy_iconv): New prototype.
* doc/cpp.texi: Document character set handling.
* doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=.
* doc/extend.texi: Delete entire section on multiline strings.
Rewrite section on __FUNCTION__ etc now that these are
variables in C.
* cppucnid.tab, cppucnid.pl: New files.
* cppucnid.h: New generated file.
* cppcharset.c: Include cppucnid.h. Lots of commentary added.
(iconv_open, iconv, iconv_close): Provide dummy definitions
if !HAVE_ICONV.
(SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv,
_cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn,
emit_numeric_escape, convert_hex, convert_oct, convert_escape,
cpp_interpret_string, narrow_str_to_charconst,
wide_str_to_charconst): New.
(ucn_valid_in_identifier): Use a binary search through the
ucnranges table defined in cppucnid.h, not a long chain of if
statements.
(_cpp_valid_ucn): Add a limit pointer. Downgrade "universal
character names are only valid in C++ and C99" to a warning.
Issue the "meaning of \[uU] is different in traditional C"
warning here. Take care not to let iconv see an invalid UCS
value if we get a malformed UCN. Issue an error if we don't
have iconv.
(cpp_interpret_charconst): Moved here from cpplex.c. Use
cpp_interpret_string to do the heavy lifting.
* cppinit.c (cpp_create_reader): Initialize bytes_big_endian,
narrow_charset, wide_charset fields of options structure.
(cpp_destroy): Call _cpp_destroy_iconv.
* cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn.
(maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete.
(cpp_interpret_charconst): Moved to cppcharset.c.
* cpplib.c (dequote_string): Delete.
(interpret_string_notranslate): New.
(do_line, do_linemarker): Use interpret_string_notranslate.
* Makefile.in (cppcharset.o): Depend on cppucnid.h.
* c-common.c (fname_string, combine_strings): Delete.
* c-common.h (fname_string, combine_strings): Delete prototypes.
* c-lex.c (ignore_escape_flag): Delete.
(cb_ident): Use cpp_interpret_string, not lex_string.
(get_nonpadding_token): New function.
(c_lex): Handle Objective-C @-prefixed identifiers and strings here.
Adjust calls to lex_string. Don't write *value twice.
(lex_string): Now handles string constant concatenation.
Most of the work handed off to cpp_interpret_string.
Call fix_string_type here.
* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with
FUNC_NAME, throughout.
(OBJC_STRING): New token type.
(primary:STRING): No need to call fix_string_type here.
(primary:objc_string): Make that OBJC_STRING.
(objc_string nonterminal): Delete.
(yylexname): Delete code to handle fake string constants.
(yylexstring): Delete entirely.
(_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need
to handle CPP_ATSIGN.
* c.opt (-fexec-charset=, -fwide-exec-charset=): New options.
* c-opts.c (missing_arg, c_common_handle_option): Handle
OPT_fexec_charset_ and OPT_fwide_exec_charset_.
(c_common_init): Set cpp_opts->bytes_big_endian, not
cpp_opts->EBCDIC. Call cpp_init_iconv.
(print_help): Document -fexec-charset= and -fexec-wide-charset=.
(TARGET_EBCDIC): Delete default definition.
* objc/objc-act.c (build_objc_string_object): No need to
handle string constant concatenation.
cp:
* parser.c (cp_lexer_read_token): No need to handle string
constant concatenation.
testsuite:
* gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c
everywhere.
* gcc.dg/concat.c: Concatenation of string constants with
__FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error.
* gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp.
* gcc.dg/cpp/escape-2.c: Use wide character constants where
necessary to avoid multi-character character constant warning.
* gcc.dg/cpp/escape.c: Likewise.
* gcc.dg/cpp/ucs.c: Likewise.
Remove backslashes from dg-bogus comments, as they confuse Tcl.
Fix a typo.
libstdc++-v3:
* testsuite/22_locale/collate/compare/wchar_t/2.cc
* testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
* testsuite/22_locale/collate/hash/wchar_t/2.cc
* testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
* testsuite/22_locale/collate/transform/wchar_t/2.cc
* testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
* testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
XFAIL on all targets.
From-SVN: r68952
2003-07-05 02:24:00 +02:00
|
|
|
cpp_opts->bytes_big_endian = BYTES_BIG_ENDIAN;
|
|
|
|
|
|
|
|
/* This can't happen until after wchar_precision and bytes_big_endian
|
|
|
|
are known. */
|
|
|
|
cpp_init_iconv (parse_in);
|
2002-08-12 08:02:53 +02:00
|
|
|
|
2005-05-18 22:45:26 +02:00
|
|
|
if (version_flag)
|
|
|
|
c_common_print_pch_checksum (stderr);
|
|
|
|
|
2003-03-07 00:12:30 +01:00
|
|
|
if (flag_preprocess_only)
|
|
|
|
{
|
2004-02-05 07:52:26 +01:00
|
|
|
finish_options ();
|
|
|
|
preprocess_file (parse_in);
|
c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
2003-03-08 22:12:26 +01:00
|
|
|
return false;
|
2003-03-07 00:12:30 +01:00
|
|
|
}
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
/* Has to wait until now so that cpplib has its hash table. */
|
2002-08-12 08:02:53 +02:00
|
|
|
init_pragma ();
|
|
|
|
|
c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
2003-03-08 22:12:26 +01:00
|
|
|
return true;
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
|
|
|
|
2003-07-11 10:33:21 +02:00
|
|
|
/* Initialize the integrated preprocessor after debug output has been
|
|
|
|
initialized; loop over each input file. */
|
2003-03-14 22:47:50 +01:00
|
|
|
void
|
PR 12267, 12391, 12560, 13129, 14114, 14113
* c-tree.h: Forward declare struct c_binding. Declare
c_override_bindings_to_false. Update prototypes.
(struct lang_identifier): Update comments. Change fields to be
struct c_binding *.
(IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE)
(IDENTIFIER_LABEL_VALUE, C_DECL_INVISIBLE)
(KEEP_NO, KEEP_YES, KEEP_MAYBE): Delete.
(C_DECL_IN_EXTERNAL_SCOPE, C_DECL_DECLARED_BUILTIN): New.
* c-common.h: Update prototypes.
* c-decl.c (struct c_scope): Update commentary. Remove names,
names_last, parms, parms_last, tags, and shadowed fields. Add
bindings and depth fields.
(scope_freelist): Move to more appropriate location.
(c_print_identifier): Update for changes to struct lang_identifier.
(objc_mark_locals_volatile): Update for new bindings structures.
(global_bindings_p): Honor c_override_global_bindings_to_false.
(pushlevel): Rename to push_scope; take no arguments; use the
scope_freelist; initialize scope->depth and check for overflow.
(poplevel): Rename to pop_scope; totally rewritten for new bindings
structures.
(diagnose_mismatched_decls): Use C_DECL_DECLARED_BUILTIN, not
C_DECL_INVISIBLE, for certain decisions. Adjust some diagnostics.
Improve some commentary. Adjust handling of forward parm decls.
(merge_decls): Set C_DECL_DECLARED_BUILTIN when appropriate.
Preserve C_DECL_IN_EXTERNAL_SCOPE.
(warn_if_shadowing): Correct indentation. Improve diagnostics.
(pushdecl): Remove unnecessary assertion. Short-circuit anonymous
decls. Rewrite for new bindings structures. Improve commentary.
Eliminate the copy_node call.
(implicit_decl_warning): Use the "diag" idiom (as seen in
locate_old_decl) to reduce code duplication; call locate_old_decl
if appropriate. Relocate to remove need for forward declaration.
(implicitly_declare): Adjust for new bindings structures. Kludge
around Objective-C not-really-builtin functions.
(undeclared_variable): Improve diagnostics. If current_function_decl
is nonnull but current_function_scope is null, use current_scope.
Use bind.
(lookup_tag): Adjust for new bindings structures. Kludge around
Objective-C's tag declarations that wind up in the external scope.
(lookup_name): Adjust for new bindings structures. Kludge around
c-common.c's pseudo-typedefs that wind up in the external scope.
(lookup_name_current_level): Rename lookup_name_in_scope; take a
second argument indicating the scope to examine; rewrite for
new bindings structures.
(c_init_decl_processing): Adjust for renamed functions. Do not
initialize current_file_decl, first_builtin_decl, last_builtin_decl.
First scope pushed is the external scope, not the global scope.
(builtin_function): Use bind, not pushdecl. Adjust other bits
for new data structures. Keep track of builtins that should be
made visible automatically.
(start_decl): Adjust diagnostics. Remove unnecessary call to
expand_decl.
(grokparms): Return 0 if arg_types is error_mark_node.
(get_parm_info): Rename "void_at_end" argument to "ellipsis", with
reversed sense. Rewrite for new bindings structures. Do not
leave any decls in the scope, to prevent pop_scope from doing
contradictory things with them.
(finish_struct, finish_enum): Remove redundant diagnostics.
(build_enumerator): Don't cascade diagnostics for error_mark_node.
Mark location where -pedantic changes the meaning of the program.
(store_parm_decls_newstyle, store_parm_decls_oldstyle): Load the
parameter decls into the function's scope structure using bind.
Warn here about function definitions in the wrong style.
Adjust diagnostics.
(store_parm_decls): Correct the determination of whether a
function was defined with a prototype.
(c_write_global_declarations): Operate on all file decls and on
the external scope. Split body of the loop to...
(c_write_global_declarations_1): ... this new function, to avoid
code duplication.
(truly_local_externals, first_builtin_decl, last_builtin_decl)
(make_scope, pop_scope, in_parm_level_p, set_block)
(any_external_decl, record_external_decl, bind_label, getdecls)
(link_hash_hash, link_hash_eq, merge_translation_unit_decls)
(c_reset_state): Delete.
(visible_builtins, c_override_global_bindings_to_false)
(c_binding, I_SYMBOL_BINDING, I_SYMBOL_DECL, I_TAG_BINDING)
(I_TAG_DECL, I_LABEL_BINDING, I_LABEL_DECL, file_scope)
(external_scope, binding_freelist, bind, free_binding_and_advance)
(push_file_scope, pop_file_scope): New.
(pushtag, pushdecl_top_level, lookup_label, declare_label)
(define_label, c_make_fname_decl, finish_decl)
(mark_forward_parm_decls, build_compound_literal)
(grokdeclarator, start_function, check_for_loop_decls)
(identifier_global_value, record_builtin_type): Minor adjustments
for new bindings structures. Improve diagnostics and commentary.
* c-objc-common.c (start_cdtor, finish_cdtor): Adjust calls to
pushlevel/poplevel respectively.
(c_objc_common_finish_file): Don't call merge_translation_unit_decls.
* c-opts.c (c_common_parse_file): Remove spurious ATTRIBUTE_UNUSED.
Warn about YYDEBUG not being defined only if -dy. Remove no-longer-
correct loop over multiple translation units; call fatal_error if
requested to compile more than one file at once. (This disables
IMA temporarily - an up-front error being preferable to a crash.)
* c-parse.in (pushlevel, poplevel rules): Rename push_scope, pop_scope.
(all actions): Adjust calls to pushlevel/poplevel.
(parsing_iso_function_signature): Delete.
(extdef_1): Fold into extdef.
(old_style_parm_decls_1): Fold into old_style_parm_decls. Don't
warn here about function definitions in the wrong style.
(after_tyle_declarator, parm_declarator_starttypename)
(parm_declarator_nostarttypename, notype_declarator): Remove
commented-out productions.
(parmlist_1, parmlist_2): Use make_node, not tree_cons, to create
an empty TREE_LIST node. Adjust calls to get_parm_info.
(parmlist_2 : ELLIPSIS): Tag the arg-info block with error_mark_node
to suppress -Wold-style-definition after this error.
(c_parse_file): Don't clear the binding stack or call
finish_fname_decls here. Correct comment.
* c-typeck.c (same_translation_unit_p): Export.
(common_type): Use c_override_global_bindings_to_false, not
pushlevel/poplevel/declare_parm_level.
* c-lang.c: Override LANG_HOOKS_CLEAR_BINDING_STACK,
LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK,
and LANG_HOOKS_GETDECLS with do-nothing stubs.
* objc/objc-lang.c: Likewise.
* objc/objc-act.c: Adjust all calls to pushlevel, poplevel,
get_parm_info.
(OBJC_VOID_AT_END): Delete; replace all uses
with void_list_node.
(generate_forward_declaration_to_string_table): Delete.
* objc/objc-act.h (OCTI_STRG_DECL, UOBJC_STRINGS_decl): Delete.
* coverage.c (create_coverage): Don't pushdecl anything.
* langhooks.c (lhd_clear_binding_stack): Call
lang_hooks.decls.poplevel, not poplevel.
* tree.c (list_length): If ENABLE_TREE_CHECKING, abort on a
circular list rather than going into an infinite loop.
cp:
* cp-lang.c (c_reset_state): Delete.
(push_file_scope, pop_file_scope): New stubs.
* parser.c (c_parse_file): Call sorry() here if called more than once.
testsuite:
* gcc.dg/Wold-style-definition-1.c, gcc.dg/builtins-30.c
* gcc.dg/unused-4.c, gcc.dg/noncompile/label-1.c
* gcc.dg/noncompile/label-lineno-1.c, objc.dg/naming-1.m:
Adjust error regexps.
* gcc.dg/Wshadow-2.c, gcc.dg/noncompile/incomplete-3.c
* gcc.dg/noncompile/undeclared-1.c: New test cases.
* gcc.dg/decl-5.c, gcc.dg/redecl-1.c: Remove XFAIL.
* gcc.dg/local1.c: Add explanatory comment.
From-SVN: r79883
2004-03-24 00:47:53 +01:00
|
|
|
c_common_parse_file (int set_yydebug)
|
2003-03-14 22:47:50 +01:00
|
|
|
{
|
2004-07-09 23:30:35 +02:00
|
|
|
unsigned int i;
|
|
|
|
|
PR 12267, 12391, 12560, 13129, 14114, 14113
* c-tree.h: Forward declare struct c_binding. Declare
c_override_bindings_to_false. Update prototypes.
(struct lang_identifier): Update comments. Change fields to be
struct c_binding *.
(IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE)
(IDENTIFIER_LABEL_VALUE, C_DECL_INVISIBLE)
(KEEP_NO, KEEP_YES, KEEP_MAYBE): Delete.
(C_DECL_IN_EXTERNAL_SCOPE, C_DECL_DECLARED_BUILTIN): New.
* c-common.h: Update prototypes.
* c-decl.c (struct c_scope): Update commentary. Remove names,
names_last, parms, parms_last, tags, and shadowed fields. Add
bindings and depth fields.
(scope_freelist): Move to more appropriate location.
(c_print_identifier): Update for changes to struct lang_identifier.
(objc_mark_locals_volatile): Update for new bindings structures.
(global_bindings_p): Honor c_override_global_bindings_to_false.
(pushlevel): Rename to push_scope; take no arguments; use the
scope_freelist; initialize scope->depth and check for overflow.
(poplevel): Rename to pop_scope; totally rewritten for new bindings
structures.
(diagnose_mismatched_decls): Use C_DECL_DECLARED_BUILTIN, not
C_DECL_INVISIBLE, for certain decisions. Adjust some diagnostics.
Improve some commentary. Adjust handling of forward parm decls.
(merge_decls): Set C_DECL_DECLARED_BUILTIN when appropriate.
Preserve C_DECL_IN_EXTERNAL_SCOPE.
(warn_if_shadowing): Correct indentation. Improve diagnostics.
(pushdecl): Remove unnecessary assertion. Short-circuit anonymous
decls. Rewrite for new bindings structures. Improve commentary.
Eliminate the copy_node call.
(implicit_decl_warning): Use the "diag" idiom (as seen in
locate_old_decl) to reduce code duplication; call locate_old_decl
if appropriate. Relocate to remove need for forward declaration.
(implicitly_declare): Adjust for new bindings structures. Kludge
around Objective-C not-really-builtin functions.
(undeclared_variable): Improve diagnostics. If current_function_decl
is nonnull but current_function_scope is null, use current_scope.
Use bind.
(lookup_tag): Adjust for new bindings structures. Kludge around
Objective-C's tag declarations that wind up in the external scope.
(lookup_name): Adjust for new bindings structures. Kludge around
c-common.c's pseudo-typedefs that wind up in the external scope.
(lookup_name_current_level): Rename lookup_name_in_scope; take a
second argument indicating the scope to examine; rewrite for
new bindings structures.
(c_init_decl_processing): Adjust for renamed functions. Do not
initialize current_file_decl, first_builtin_decl, last_builtin_decl.
First scope pushed is the external scope, not the global scope.
(builtin_function): Use bind, not pushdecl. Adjust other bits
for new data structures. Keep track of builtins that should be
made visible automatically.
(start_decl): Adjust diagnostics. Remove unnecessary call to
expand_decl.
(grokparms): Return 0 if arg_types is error_mark_node.
(get_parm_info): Rename "void_at_end" argument to "ellipsis", with
reversed sense. Rewrite for new bindings structures. Do not
leave any decls in the scope, to prevent pop_scope from doing
contradictory things with them.
(finish_struct, finish_enum): Remove redundant diagnostics.
(build_enumerator): Don't cascade diagnostics for error_mark_node.
Mark location where -pedantic changes the meaning of the program.
(store_parm_decls_newstyle, store_parm_decls_oldstyle): Load the
parameter decls into the function's scope structure using bind.
Warn here about function definitions in the wrong style.
Adjust diagnostics.
(store_parm_decls): Correct the determination of whether a
function was defined with a prototype.
(c_write_global_declarations): Operate on all file decls and on
the external scope. Split body of the loop to...
(c_write_global_declarations_1): ... this new function, to avoid
code duplication.
(truly_local_externals, first_builtin_decl, last_builtin_decl)
(make_scope, pop_scope, in_parm_level_p, set_block)
(any_external_decl, record_external_decl, bind_label, getdecls)
(link_hash_hash, link_hash_eq, merge_translation_unit_decls)
(c_reset_state): Delete.
(visible_builtins, c_override_global_bindings_to_false)
(c_binding, I_SYMBOL_BINDING, I_SYMBOL_DECL, I_TAG_BINDING)
(I_TAG_DECL, I_LABEL_BINDING, I_LABEL_DECL, file_scope)
(external_scope, binding_freelist, bind, free_binding_and_advance)
(push_file_scope, pop_file_scope): New.
(pushtag, pushdecl_top_level, lookup_label, declare_label)
(define_label, c_make_fname_decl, finish_decl)
(mark_forward_parm_decls, build_compound_literal)
(grokdeclarator, start_function, check_for_loop_decls)
(identifier_global_value, record_builtin_type): Minor adjustments
for new bindings structures. Improve diagnostics and commentary.
* c-objc-common.c (start_cdtor, finish_cdtor): Adjust calls to
pushlevel/poplevel respectively.
(c_objc_common_finish_file): Don't call merge_translation_unit_decls.
* c-opts.c (c_common_parse_file): Remove spurious ATTRIBUTE_UNUSED.
Warn about YYDEBUG not being defined only if -dy. Remove no-longer-
correct loop over multiple translation units; call fatal_error if
requested to compile more than one file at once. (This disables
IMA temporarily - an up-front error being preferable to a crash.)
* c-parse.in (pushlevel, poplevel rules): Rename push_scope, pop_scope.
(all actions): Adjust calls to pushlevel/poplevel.
(parsing_iso_function_signature): Delete.
(extdef_1): Fold into extdef.
(old_style_parm_decls_1): Fold into old_style_parm_decls. Don't
warn here about function definitions in the wrong style.
(after_tyle_declarator, parm_declarator_starttypename)
(parm_declarator_nostarttypename, notype_declarator): Remove
commented-out productions.
(parmlist_1, parmlist_2): Use make_node, not tree_cons, to create
an empty TREE_LIST node. Adjust calls to get_parm_info.
(parmlist_2 : ELLIPSIS): Tag the arg-info block with error_mark_node
to suppress -Wold-style-definition after this error.
(c_parse_file): Don't clear the binding stack or call
finish_fname_decls here. Correct comment.
* c-typeck.c (same_translation_unit_p): Export.
(common_type): Use c_override_global_bindings_to_false, not
pushlevel/poplevel/declare_parm_level.
* c-lang.c: Override LANG_HOOKS_CLEAR_BINDING_STACK,
LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK,
and LANG_HOOKS_GETDECLS with do-nothing stubs.
* objc/objc-lang.c: Likewise.
* objc/objc-act.c: Adjust all calls to pushlevel, poplevel,
get_parm_info.
(OBJC_VOID_AT_END): Delete; replace all uses
with void_list_node.
(generate_forward_declaration_to_string_table): Delete.
* objc/objc-act.h (OCTI_STRG_DECL, UOBJC_STRINGS_decl): Delete.
* coverage.c (create_coverage): Don't pushdecl anything.
* langhooks.c (lhd_clear_binding_stack): Call
lang_hooks.decls.poplevel, not poplevel.
* tree.c (list_length): If ENABLE_TREE_CHECKING, abort on a
circular list rather than going into an infinite loop.
cp:
* cp-lang.c (c_reset_state): Delete.
(push_file_scope, pop_file_scope): New stubs.
* parser.c (c_parse_file): Call sorry() here if called more than once.
testsuite:
* gcc.dg/Wold-style-definition-1.c, gcc.dg/builtins-30.c
* gcc.dg/unused-4.c, gcc.dg/noncompile/label-1.c
* gcc.dg/noncompile/label-lineno-1.c, objc.dg/naming-1.m:
Adjust error regexps.
* gcc.dg/Wshadow-2.c, gcc.dg/noncompile/incomplete-3.c
* gcc.dg/noncompile/undeclared-1.c: New test cases.
* gcc.dg/decl-5.c, gcc.dg/redecl-1.c: Remove XFAIL.
* gcc.dg/local1.c: Add explanatory comment.
From-SVN: r79883
2004-03-24 00:47:53 +01:00
|
|
|
if (set_yydebug)
|
2006-12-10 06:09:29 +01:00
|
|
|
switch (c_language)
|
|
|
|
{
|
|
|
|
case clk_c:
|
|
|
|
warning(0, "The C parser does not support -dy, option ignored");
|
|
|
|
break;
|
|
|
|
case clk_objc:
|
|
|
|
warning(0,
|
|
|
|
"The Objective-C parser does not support -dy, option ignored");
|
|
|
|
break;
|
|
|
|
case clk_cxx:
|
|
|
|
warning(0, "The C++ parser does not support -dy, option ignored");
|
|
|
|
break;
|
|
|
|
case clk_objcxx:
|
|
|
|
warning(0,
|
|
|
|
"The Objective-C++ parser does not support -dy, option ignored");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
|
|
|
}
|
2003-03-14 22:47:50 +01:00
|
|
|
|
2004-07-09 23:30:35 +02:00
|
|
|
i = 0;
|
|
|
|
for (;;)
|
|
|
|
{
|
2005-03-23 00:18:43 +01:00
|
|
|
/* Start the main input file, if the debug writer wants it. */
|
|
|
|
if (debug_hooks->start_end_main_source_file)
|
|
|
|
(*debug_hooks->start_source_file) (0, this_input_filename);
|
2004-07-09 23:30:35 +02:00
|
|
|
finish_options ();
|
|
|
|
pch_init ();
|
|
|
|
push_file_scope ();
|
|
|
|
c_parse_file ();
|
|
|
|
finish_file ();
|
|
|
|
pop_file_scope ();
|
2005-03-23 00:18:43 +01:00
|
|
|
/* And end the main input file, if the debug writer wants it */
|
|
|
|
if (debug_hooks->start_end_main_source_file)
|
|
|
|
(*debug_hooks->end_source_file) (0);
|
2004-07-09 23:30:35 +02:00
|
|
|
if (++i >= num_in_fnames)
|
|
|
|
break;
|
|
|
|
cpp_undef_all (parse_in);
|
|
|
|
this_input_filename
|
|
|
|
= cpp_read_main_file (parse_in, in_fnames[i]);
|
|
|
|
/* If an input file is missing, abandon further compilation.
|
2006-05-19 00:16:23 +02:00
|
|
|
cpplib has issued a diagnostic. */
|
2004-07-09 23:30:35 +02:00
|
|
|
if (!this_input_filename)
|
|
|
|
break;
|
|
|
|
}
|
2003-03-14 22:47:50 +01:00
|
|
|
}
|
|
|
|
|
2002-08-12 00:22:28 +02:00
|
|
|
/* Common finish hook for the C, ObjC and C++ front ends. */
|
|
|
|
void
|
2003-06-22 15:41:26 +02:00
|
|
|
c_common_finish (void)
|
2002-08-12 00:22:28 +02:00
|
|
|
{
|
|
|
|
FILE *deps_stream = NULL;
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
if (cpp_opts->deps.style != DEPS_NONE)
|
2002-08-12 00:22:28 +02:00
|
|
|
{
|
|
|
|
/* If -M or -MM was seen without -MF, default output to the
|
|
|
|
output stream. */
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
if (!deps_file)
|
2002-08-12 00:22:28 +02:00
|
|
|
deps_stream = out_stream;
|
|
|
|
else
|
|
|
|
{
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
deps_stream = fopen (deps_file, deps_append ? "a": "w");
|
2002-08-12 00:22:28 +02:00
|
|
|
if (!deps_stream)
|
diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
(output_printf, output_verbatim, diagnostic_set_info,
verbatim): Set err_no field of the text_info structure being
initialized.
(fatal_io_error): Delete function.
* diagnostic.h (text_info): Add err_no field.
* toplev.h (fatal_io_error): Delete prototype.
* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
* objc/objc-act.c: Replace all calls to fatal_io_error with
calls to fatal_error; add ": %m" to the end of all the affected
error messages.
From-SVN: r66769
2003-05-13 20:06:52 +02:00
|
|
|
fatal_error ("opening dependency file %s: %m", deps_file);
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* For performance, avoid tearing down cpplib's internal structures
|
|
|
|
with cpp_destroy (). */
|
|
|
|
errorcount += cpp_finish (parse_in, deps_stream);
|
|
|
|
|
|
|
|
if (deps_stream && deps_stream != out_stream
|
|
|
|
&& (ferror (deps_stream) || fclose (deps_stream)))
|
diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
(output_printf, output_verbatim, diagnostic_set_info,
verbatim): Set err_no field of the text_info structure being
initialized.
(fatal_io_error): Delete function.
* diagnostic.h (text_info): Add err_no field.
* toplev.h (fatal_io_error): Delete prototype.
* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
* objc/objc-act.c: Replace all calls to fatal_io_error with
calls to fatal_error; add ": %m" to the end of all the affected
error messages.
From-SVN: r66769
2003-05-13 20:06:52 +02:00
|
|
|
fatal_error ("closing dependency file %s: %m", deps_file);
|
2002-08-12 00:22:28 +02:00
|
|
|
|
|
|
|
if (out_stream && (ferror (out_stream) || fclose (out_stream)))
|
diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
(output_printf, output_verbatim, diagnostic_set_info,
verbatim): Set err_no field of the text_info structure being
initialized.
(fatal_io_error): Delete function.
* diagnostic.h (text_info): Add err_no field.
* toplev.h (fatal_io_error): Delete prototype.
* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
* objc/objc-act.c: Replace all calls to fatal_io_error with
calls to fatal_error; add ": %m" to the end of all the affected
error messages.
From-SVN: r66769
2003-05-13 20:06:52 +02:00
|
|
|
fatal_error ("when writing output to %s: %m", out_fname);
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Either of two environment variables can specify output of
|
|
|
|
dependencies. Their value is either "OUTPUT_FILE" or "OUTPUT_FILE
|
|
|
|
DEPS_TARGET", where OUTPUT_FILE is the file to write deps info to
|
|
|
|
and DEPS_TARGET is the target to mention in the deps. They also
|
|
|
|
result in dependency information being appended to the output file
|
2002-08-15 00:34:50 +02:00
|
|
|
rather than overwriting it, and like Sun's compiler
|
|
|
|
SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */
|
2002-08-12 00:22:28 +02:00
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
check_deps_environment_vars (void)
|
2002-08-12 00:22:28 +02:00
|
|
|
{
|
|
|
|
char *spec;
|
|
|
|
|
|
|
|
GET_ENVIRONMENT (spec, "DEPENDENCIES_OUTPUT");
|
|
|
|
if (spec)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
cpp_opts->deps.style = DEPS_USER;
|
2002-08-12 00:22:28 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
GET_ENVIRONMENT (spec, "SUNPRO_DEPENDENCIES");
|
|
|
|
if (spec)
|
2002-08-15 00:34:50 +02:00
|
|
|
{
|
|
|
|
cpp_opts->deps.style = DEPS_SYSTEM;
|
|
|
|
cpp_opts->deps.ignore_main_file = true;
|
|
|
|
}
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (spec)
|
|
|
|
{
|
|
|
|
/* Find the space before the DEPS_TARGET, if there is one. */
|
|
|
|
char *s = strchr (spec, ' ');
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
/* Let the caller perform MAKE quoting. */
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
defer_opt (OPT_MT, s + 1);
|
2002-08-12 00:22:28 +02:00
|
|
|
*s = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Command line -MF overrides environment variables and default. */
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
if (!deps_file)
|
|
|
|
deps_file = spec;
|
2002-08-12 00:22:28 +02:00
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
deps_append = 1;
|
2004-11-30 15:10:08 +01:00
|
|
|
deps_seen = true;
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle deferred command line switches. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
handle_deferred_opts (void)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
{
|
|
|
|
size_t i;
|
2004-06-05 22:58:06 +02:00
|
|
|
struct deps *deps;
|
|
|
|
|
|
|
|
/* Avoid allocating the deps buffer if we don't need it.
|
|
|
|
(This flag may be true without there having been -MT or -MQ
|
|
|
|
options, but we'll still need the deps buffer.) */
|
|
|
|
if (!deps_seen)
|
|
|
|
return;
|
|
|
|
|
|
|
|
deps = cpp_get_deps (parse_in);
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
|
|
|
|
for (i = 0; i < deferred_count; i++)
|
|
|
|
{
|
|
|
|
struct deferred_opt *opt = &deferred_opts[i];
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
if (opt->code == OPT_MT || opt->code == OPT_MQ)
|
2004-06-05 22:58:06 +02:00
|
|
|
deps_add_target (deps, opt->arg, opt->code == OPT_MQ);
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* These settings are appropriate for GCC, but not necessarily so for
|
|
|
|
cpplib as a library. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
sanitize_cpp_opts (void)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
{
|
|
|
|
/* If we don't know what style of dependencies to output, complain
|
|
|
|
if any other dependency switches have been given. */
|
|
|
|
if (deps_seen && cpp_opts->deps.style == DEPS_NONE)
|
|
|
|
error ("to generate dependencies you must specify either -M or -MM");
|
|
|
|
|
|
|
|
/* -dM and dependencies suppress normal output; do it here so that
|
|
|
|
the last -d[MDN] switch overrides earlier ones. */
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
if (flag_dump_macros == 'M')
|
|
|
|
flag_no_output = 1;
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
|
|
|
|
/* Disable -dD, -dN and -dI if normal output is suppressed. Allow
|
|
|
|
-dM since at least glibc relies on -M -dM to work. */
|
c-common.c, [...]: Fix comment formatting.
* c-common.c, c-opts.c, combine.c, cse.c, dojump.c,
gimplify.c, tree-dfa.c, tree-ssa-loop-ivopts.c,
tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-sink.c,
tree-vect-analyze.c, tree.def, tree.h: Fix comment formatting.
From-SVN: r96104
2005-03-08 14:57:01 +01:00
|
|
|
/* Also, flag_no_output implies flag_no_line_commands, always. */
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
if (flag_no_output)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
{
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
if (flag_dump_macros != 'M')
|
|
|
|
flag_dump_macros = 0;
|
|
|
|
flag_dump_includes = 0;
|
2004-11-29 00:29:41 +01:00
|
|
|
flag_no_line_commands = 1;
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
|
|
|
|
cpp_opts->unsigned_char = !flag_signed_char;
|
|
|
|
cpp_opts->stdc_0_in_system_headers = STDC_0_IN_SYSTEM_HEADERS;
|
|
|
|
|
|
|
|
/* We want -Wno-long-long to override -pedantic -std=non-c99
|
|
|
|
and/or -Wtraditional, whatever the ordering. */
|
|
|
|
cpp_opts->warn_long_long
|
|
|
|
= warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional);
|
2003-08-05 23:15:57 +02:00
|
|
|
|
2004-02-19 23:18:50 +01:00
|
|
|
/* Similarly with -Wno-variadic-macros. No check for c99 here, since
|
|
|
|
this also turns off warnings about GCCs extension. */
|
|
|
|
cpp_opts->warn_variadic_macros
|
|
|
|
= warn_variadic_macros && (pedantic || warn_traditional);
|
|
|
|
|
2003-08-05 23:15:57 +02:00
|
|
|
/* If we're generating preprocessor output, emit current directory
|
|
|
|
if explicitly requested or if debugging information is enabled.
|
|
|
|
??? Maybe we should only do it for debugging formats that
|
|
|
|
actually output the current directory? */
|
|
|
|
if (flag_working_directory == -1)
|
|
|
|
flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE);
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
}
|
|
|
|
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
/* Add include path with a prefix at the front of its name. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
add_prefixed_path (const char *suffix, size_t chain)
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
{
|
2003-03-10 21:02:27 +01:00
|
|
|
char *path;
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
const char *prefix;
|
2003-03-10 21:02:27 +01:00
|
|
|
size_t prefix_len, suffix_len;
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
|
2003-03-10 21:02:27 +01:00
|
|
|
suffix_len = strlen (suffix);
|
|
|
|
prefix = iprefix ? iprefix : cpp_GCC_INCLUDE_DIR;
|
|
|
|
prefix_len = iprefix ? strlen (iprefix) : cpp_GCC_INCLUDE_DIR_len;
|
|
|
|
|
2004-07-25 22:43:23 +02:00
|
|
|
path = (char *) xmalloc (prefix_len + suffix_len + 1);
|
2003-03-10 21:02:27 +01:00
|
|
|
memcpy (path, prefix, prefix_len);
|
|
|
|
memcpy (path + prefix_len, suffix, suffix_len);
|
|
|
|
path[prefix_len + suffix_len] = '\0';
|
|
|
|
|
2004-05-22 04:39:35 +02:00
|
|
|
add_path (path, chain, 0, false);
|
Makefile.in (C_AND_OBJC_OBJS, [...]): Update.
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS,
cppinit.o, cppdefault.o, fix-header): Update.
* c-incpath.c: New file.
* c-incpath.h: New file.
* c-lex.c: Include c-incpath.h.
(init_c_lex): Register path simplifier.
* c-opts.c: Include cppdefault.h and c-incpath.h.
(TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc,
std_cxx_inc, quote_chain_split, add_prefixed_path): New.
(COMMAND_LINE_OPTIONS): Add more options from cpplib.
(missing_arg, c_common_decode_option): Handle them.
(c_common_post_options): Register include chains.
(print_help): Update.
* cppdefault.h (struct default include): Update.
Move some macros to ...
* cppdefault.c: ... here.
(cpp_include_defaults): Add extra field add_sysroot.
* cppfiles.c (include_file, search_from, find_or_create_entry,
cpp_included, find_include_file, remap_filename): Update for
renaming of search_path to cpp_path, and of the chain headers.
(remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c.
* cpphash.h (struct search_path): Move to cpplib.h.
(struct cpp_buffer, struct cpp_reader): Update.
(_cpp_simplify_pathname): Remove.
* cppinit.c: Don't include prefix.h and cppdefault.h.
(INO_T_EQ, INO_T_COPY, path_include, append_include_chain,
remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs,
init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir,
no_pth, cpp_handle_options): Remove.
(struct pending_option): Remove chain members.
(cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS,
cpp_handle_option): Update.
* cpplib.h (struct cpp_path, cpp_set_include_chains): New.
(struct cpp_options): Remove quote_include, bracket_include,
include_prefix, include_prefix_len, verbose, ignore_srcdir,
no_standard_includes, no_standard_cplusplus_includes.
(struct cpp_callbacks): Add simplify_path.
(cpp_handle_options): Remove.
* fix-header.c: Include c-incpath.h.
(read_scan_file): Update to use c-incpath functionality.
* doc/passes.texi: Update.
cp:
* Make-lang.in (CXX_C_OBJS): Update.
From-SVN: r63612
2003-03-01 15:31:21 +01:00
|
|
|
}
|
|
|
|
|
2004-02-05 07:52:26 +01:00
|
|
|
/* Handle -D, -U, -A, -imacros, and the first -include. */
|
|
|
|
static void
|
|
|
|
finish_options (void)
|
2003-03-15 00:47:24 +01:00
|
|
|
{
|
|
|
|
if (!cpp_opts->preprocessed)
|
|
|
|
{
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
size_t i;
|
|
|
|
|
2005-04-25 01:27:37 +02:00
|
|
|
cb_file_change (parse_in,
|
|
|
|
linemap_add (&line_table, LC_RENAME, 0,
|
|
|
|
_("<built-in>"), 0));
|
|
|
|
|
2003-05-11 15:43:36 +02:00
|
|
|
cpp_init_builtins (parse_in, flag_hosted);
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
c_cpp_builtins (parse_in);
|
2003-06-12 08:09:15 +02:00
|
|
|
|
|
|
|
/* We're about to send user input to cpplib, so make it warn for
|
|
|
|
things that we previously (when we sent it internal definitions)
|
|
|
|
told it to not warn.
|
|
|
|
|
|
|
|
C99 permits implementation-defined characters in identifiers.
|
|
|
|
The documented meaning of -std= is to turn off extensions that
|
|
|
|
conflict with the specified standard, and since a strictly
|
|
|
|
conforming program cannot contain a '$', we do not condition
|
|
|
|
their acceptance on the -std= setting. */
|
|
|
|
cpp_opts->warn_dollars = (cpp_opts->pedantic && !cpp_opts->c99);
|
|
|
|
|
2006-06-01 18:36:25 +02:00
|
|
|
cb_file_change (parse_in,
|
|
|
|
linemap_add (&line_table, LC_RENAME, 0,
|
|
|
|
_("<command-line>"), 0));
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
for (i = 0; i < deferred_count; i++)
|
|
|
|
{
|
|
|
|
struct deferred_opt *opt = &deferred_opts[i];
|
|
|
|
|
|
|
|
if (opt->code == OPT_D)
|
|
|
|
cpp_define (parse_in, opt->arg);
|
|
|
|
else if (opt->code == OPT_U)
|
|
|
|
cpp_undef (parse_in, opt->arg);
|
|
|
|
else if (opt->code == OPT_A)
|
|
|
|
{
|
|
|
|
if (opt->arg[0] == '-')
|
|
|
|
cpp_unassert (parse_in, opt->arg + 1);
|
|
|
|
else
|
|
|
|
cpp_assert (parse_in, opt->arg);
|
|
|
|
}
|
|
|
|
}
|
2003-03-15 00:47:24 +01:00
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.h (cb_register_builtins): Rename c_cpp_builtins.
* c-lex.c (init_c_lex): Register builtins hook is dead.
* c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U.
(c_common_decode_option): Don't call cpp_handle_option.
Handle -A, -D and -U.
(handle_deferred_opts): Simplify.
(finish_options): Define builtins and command line macros.
* c-ppoutput.c (init_pp_output): Register builtins hook is dead.
* cppinit.c: Don't include intl.h.
(init_builtins): Rename cpp_init_builtins. No hook to call.
(init_library): Don't need to sort options.
(cpp_create_reader): Don't set pending.
(cpp_destroy): Don't free pending.
(struct pending_option, cl_directive_handler, struct cpp_pending,
APPEND, free_chain, new_pending_directive, parse_option, opt_comp,
cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option,
cl_options, cpp_handle_option): Remove.
* cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option,
cpp_finish_options): Remove.
(cpp_init_builtins): New.
* fix-header.c (read_scan_file): Update to handle -D. Fix
handling of -I. Replace call to cpp_finish_options.
cp:
* Make-lang.in: Update.
From-SVN: r64398
2003-03-15 13:18:47 +01:00
|
|
|
/* Handle -imacros after -D and -U. */
|
2003-03-15 00:47:24 +01:00
|
|
|
for (i = 0; i < deferred_count; i++)
|
|
|
|
{
|
|
|
|
struct deferred_opt *opt = &deferred_opts[i];
|
|
|
|
|
|
|
|
if (opt->code == OPT_imacros
|
|
|
|
&& cpp_push_include (parse_in, opt->arg))
|
2003-11-05 22:09:04 +01:00
|
|
|
{
|
2003-12-21 15:08:35 +01:00
|
|
|
/* Disable push_command_line_include callback for now. */
|
2003-11-05 22:09:04 +01:00
|
|
|
include_cursor = deferred_count + 1;
|
|
|
|
cpp_scan_nooutput (parse_in);
|
|
|
|
}
|
2003-03-15 00:47:24 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-15 07:36:25 +02:00
|
|
|
include_cursor = 0;
|
2003-03-15 00:47:24 +01:00
|
|
|
push_command_line_include ();
|
|
|
|
}
|
|
|
|
|
2003-03-14 22:47:50 +01:00
|
|
|
/* Give CPP the next file given by -include, if any. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
push_command_line_include (void)
|
2003-03-14 22:47:50 +01:00
|
|
|
{
|
|
|
|
while (include_cursor < deferred_count)
|
|
|
|
{
|
|
|
|
struct deferred_opt *opt = &deferred_opts[include_cursor++];
|
2003-06-22 15:41:26 +02:00
|
|
|
|
c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
code formatting conventions.
From-SVN: r88462
2004-10-03 22:53:05 +02:00
|
|
|
if (!cpp_opts->preprocessed && opt->code == OPT_include
|
2003-10-02 09:25:03 +02:00
|
|
|
&& cpp_push_include (parse_in, opt->arg))
|
2003-03-14 22:47:50 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (include_cursor == deferred_count)
|
|
|
|
{
|
2003-10-02 09:25:03 +02:00
|
|
|
include_cursor++;
|
2003-03-14 22:47:50 +01:00
|
|
|
/* -Wunused-macros should only warn about macros defined hereafter. */
|
|
|
|
cpp_opts->warn_unused_macros = warn_unused_macros;
|
2004-02-05 07:52:26 +01:00
|
|
|
/* Restore the line map from <command line>. */
|
c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
code formatting conventions.
From-SVN: r88462
2004-10-03 22:53:05 +02:00
|
|
|
if (!cpp_opts->preprocessed)
|
2004-10-21 18:31:54 +02:00
|
|
|
cpp_change_file (parse_in, LC_RENAME, this_input_filename);
|
2004-02-05 07:52:26 +01:00
|
|
|
|
|
|
|
/* Set this here so the client can change the option if it wishes,
|
|
|
|
and after stacking the main file so we don't trace the main file. */
|
|
|
|
line_table.trace_includes = cpp_opts->print_include_names;
|
2003-03-14 22:47:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* File change callback. Has to handle -include files. */
|
|
|
|
static void
|
2004-07-25 02:13:01 +02:00
|
|
|
cb_file_change (cpp_reader * ARG_UNUSED (pfile),
|
2003-06-22 15:41:26 +02:00
|
|
|
const struct line_map *new_map)
|
2003-03-14 22:47:50 +01:00
|
|
|
{
|
|
|
|
if (flag_preprocess_only)
|
|
|
|
pp_file_change (new_map);
|
|
|
|
else
|
|
|
|
fe_file_change (new_map);
|
|
|
|
|
2003-10-02 09:25:03 +02:00
|
|
|
if (new_map == 0 || (new_map->reason == LC_LEAVE && MAIN_FILE_P (new_map)))
|
2003-03-14 22:47:50 +01:00
|
|
|
push_command_line_include ();
|
|
|
|
}
|
|
|
|
|
2004-02-05 07:52:26 +01:00
|
|
|
void
|
2004-07-25 02:13:01 +02:00
|
|
|
cb_dir_change (cpp_reader * ARG_UNUSED (pfile), const char *dir)
|
2004-02-05 07:52:26 +01:00
|
|
|
{
|
c-aux-info.c, [...]: Follow code formatting conventions.
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c,
c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow
code formatting conventions.
From-SVN: r88462
2004-10-03 22:53:05 +02:00
|
|
|
if (!set_src_pwd (dir))
|
diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.
* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.
* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.
* ada/misc.c: Adjust warning() callers.
* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.
* fortran/trans-decl.c: Adjust warning() callers.
* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.
* objc/objc-act.c: Adjust warning() callers.
* treelang/parse.y: Adjust warning() callers.
From-SVN: r98633
2005-04-23 23:29:07 +02:00
|
|
|
warning (0, "too late for # directive to set debug directory");
|
2004-02-05 07:52:26 +01:00
|
|
|
}
|
|
|
|
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
/* Set the C 89 standard (with 1994 amendments if C94, without GNU
|
|
|
|
extensions if ISO). There is no concept of gnu94. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
set_std_c89 (int c94, int iso)
|
c-opts.c (deps_seen, [...]): New.
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size,
handle_deferred_opts, sanitize_cpp_opts, defer_opt,
struct deferred_opt): New.
(COMMAND_LINE_OPTIONS): Add -M*.
(missing_arg): Update.
(c_common_decode_option): Handle -M*.
(c_common_post_options): Handle -M*. Use sanitize_cpp_opts;
don't call cpp_post_options.
(c_common_finish, check_deps_environment_vars): Update.
* cppfiles.c (stack_include_file, handle_missing_header): Update.
* cpphash.h (CPP_PRINT_DEPS): Remove.
* cppinit.c: Don't include version.h.
(cpp_create_reader): Don't call deps_init. Initialize
warn_long_long.
(cpp_read_main_file): Init deps if necessary.
(cpp_destroy): Conditionally free deps.
(cpp_finish): Update.
(no_tgt): Remove.
(COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*.
(cpp_post_options): Rename post_options.
* cpplib.h (struct cpp_options): Remove some dependency options;
move others to a new structure.
(cpp_post_options): Remove.
(cpp_finish): Comment.
* fix-header.c (read_scan_file): Don't call cpp_post_options.
treelang:
* treelang.c: Remove cpp_post_options.
From-SVN: r56239
2002-08-13 00:44:30 +02:00
|
|
|
{
|
|
|
|
cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89);
|
|
|
|
flag_iso = iso;
|
|
|
|
flag_no_asm = iso;
|
|
|
|
flag_no_gnu_keywords = iso;
|
|
|
|
flag_no_nonansi_builtin = iso;
|
|
|
|
flag_isoc94 = c94;
|
|
|
|
flag_isoc99 = 0;
|
2002-08-12 00:22:28 +02:00
|
|
|
}
|
|
|
|
|
2002-08-11 09:32:19 +02:00
|
|
|
/* Set the C 99 standard (without GNU extensions if ISO). */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
set_std_c99 (int iso)
|
2002-08-11 09:32:19 +02:00
|
|
|
{
|
|
|
|
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
|
|
|
|
flag_no_asm = iso;
|
|
|
|
flag_no_nonansi_builtin = iso;
|
|
|
|
flag_iso = iso;
|
|
|
|
flag_isoc99 = 1;
|
|
|
|
flag_isoc94 = 1;
|
|
|
|
}
|
|
|
|
|
2002-08-10 22:58:45 +02:00
|
|
|
/* Set the C++ 98 standard (without GNU extensions if ISO). */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
set_std_cxx98 (int iso)
|
2002-08-10 22:58:45 +02:00
|
|
|
{
|
|
|
|
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
|
|
|
|
flag_no_gnu_keywords = iso;
|
|
|
|
flag_no_nonansi_builtin = iso;
|
|
|
|
flag_iso = iso;
|
|
|
|
}
|
|
|
|
|
2006-11-01 17:29:06 +01:00
|
|
|
/* Set the C++ 0x working draft "standard" (without GNU extensions if ISO). */
|
|
|
|
static void
|
|
|
|
set_std_cxx0x (int iso)
|
|
|
|
{
|
|
|
|
cpp_set_lang (parse_in, iso ? CLK_CXX0X: CLK_GNUCXX0X);
|
|
|
|
flag_no_gnu_keywords = iso;
|
|
|
|
flag_no_nonansi_builtin = iso;
|
|
|
|
flag_iso = iso;
|
|
|
|
flag_cpp0x = 1;
|
|
|
|
}
|
|
|
|
|
2002-08-07 20:32:13 +02:00
|
|
|
/* Handle setting implicit to ON. */
|
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
set_Wimplicit (int on)
|
2002-08-07 20:32:13 +02:00
|
|
|
{
|
|
|
|
warn_implicit = on;
|
|
|
|
warn_implicit_int = on;
|
|
|
|
if (on)
|
|
|
|
{
|
|
|
|
if (mesg_implicit_function_declaration != 2)
|
|
|
|
mesg_implicit_function_declaration = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mesg_implicit_function_declaration = 0;
|
|
|
|
}
|
|
|
|
|
2002-08-09 08:19:08 +02:00
|
|
|
/* Args to -d specify what to dump. Silently ignore
|
2002-09-15 20:24:08 +02:00
|
|
|
unrecognized options; they may be aimed at toplev.c. */
|
2002-08-07 20:32:13 +02:00
|
|
|
static void
|
2003-06-22 15:41:26 +02:00
|
|
|
handle_OPT_d (const char *arg)
|
2002-08-07 20:32:13 +02:00
|
|
|
{
|
2002-08-09 08:19:08 +02:00
|
|
|
char c;
|
|
|
|
|
|
|
|
while ((c = *arg++) != '\0')
|
|
|
|
switch (c)
|
|
|
|
{
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
case 'M': /* Dump macros only. */
|
|
|
|
case 'N': /* Dump names. */
|
|
|
|
case 'D': /* Dump definitions. */
|
|
|
|
flag_dump_macros = c;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'I':
|
Makefile.in: Update.
* Makefile.in: Update.
* c-common.c (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes): New.
* c-common.h (flag_no_line_commands, flag_no_output,
flag_dump_macros, flag_dump_includes, preprocess_file): New.
(init_c_lex): Update prototype.
* c-lex.c (init_c_lex): Update prototype; move some code to
c_common_init.
* c-opts.c (preprocess_file): Subsume into c_common_init.
(c_common_decode_option): Update flags.
(c_common_init): Move code from preprocess_file and init_c_lex.
(sanitize_cpp_opts): Update.
* c-ppoutput.c: New, cppmain.c almost verbatim.
* cpphash.h (struct printer): Remove.
(struct cpp_reader): Remove print.
* cpplib.h (dump_none, dump_only, dump_names, dump_definitions,
cpp_preprocess_file): Remove.
(struct cpp_options): Remove no_output, no_line_commands, dump_macros
and dump_includes.
* cppmain.c: Remove.
* doc/passes.texi: Update.
From-SVN: r63773
2003-03-04 08:00:39 +01:00
|
|
|
flag_dump_includes = 1;
|
2002-08-09 08:19:08 +02:00
|
|
|
break;
|
|
|
|
}
|
2002-08-07 20:32:13 +02:00
|
|
|
}
|