From 7939616918aae0c21c6b6e415cbae13f7db1a1ae Mon Sep 17 00:00:00 2001 From: jsm28 Date: Wed, 24 Nov 2010 00:51:48 +0000 Subject: * flag-types.h (struct visibility_flags): Don't declare here. * flags.h (strip_off_ending, fast_math_flags_set_p, fast_math_flags_struct_set_p): Declare here. (visibility_options): Don't declare here. * opts-common.c (option_enabled, get_option_state): Move from opts.c. * opts-global.c: Include diagnostic.h instead of diagnostic-core.h. Include tree.h, langhooks.h, lto-streamer.h and toplev.h. (const_char_p, ignored_options, in_fnames, num_in_fnames, write_langs, complain_wrong_lang, postpone_unknown_option_warning, print_ignored_options, unknown_option_callback, post_handling_callback, lang_handle_option, add_input_filename, read_cmdline_options, initial_lang_mask, init_options_once, decode_cmdline_options_to_array_default_mask, set_default_handlers, decode_options): Move from opts.c. (print_ignored_options): Use warning_at instead of saving and restoring input_location. * opts.c: Include and . Include rtl.h instead of expr.h. Don't include langhooks.h, except.h or lto-streamer.h. Add more comments on includes. (strip_off_ending, setup_core_dumping, decode_d_option): Move from toplev.c. (visibility_options): Move to c-family/c-common.c. (const_char_p, ignored_options, in_fnames, num_in_fnames, write_langs, complain_wrong_lang, postpone_unknown_option_warning, print_ignored_options, unknown_option_callback, post_handling_callback, lang_handle_option, add_input_filename, read_cmdline_options, initial_lang_mask, init_options_once, decode_cmdline_options_to_array_default_mask, set_default_handlers, decode_options): Move to opts-global.c. (target_handle_option, default_options_optimization, finish_options, common_handle_option): Remove static. (option_enabled, get_option_state): Move to opts-common.c. * opts.h (common_handle_option, target_handle_option, finish_options, default_options_optimization): Declare. * toplev.c: Don't include or . (setup_core_dumping, strip_off_ending, decode_d_option): Move to opts.c. * toplev.h (strip_off_ending, decode_d_option, fast_math_flags_set_p, fast_math_flags_struct_set_p): Don't declare here. * Makefile.in (opts.o, opts-global.o): Update dependencies. c-family: * c-common.c (visibility_options): Move from ../opts.c. * c-common.h (struct visibility_flags, visibility_options): Declare here. * c-opts.c (finish_options): Rename to c_finish_options. (c_common_init): Update call to finish_options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167105 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/toplev.c | 93 ------------------------------------------------------------ 1 file changed, 93 deletions(-) (limited to 'gcc/toplev.c') diff --git a/gcc/toplev.c b/gcc/toplev.c index 69643581eaf..edbb076f1ea 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -28,11 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" -#include - -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif #ifdef HAVE_SYS_TIMES_H # include @@ -114,7 +109,6 @@ static void init_asm_output (const char *); static void finalize (void); static void crash_signal (int) ATTRIBUTE_NORETURN; -static void setup_core_dumping (void); static void compile_file (void); /* True if we don't need a backend (e.g. preprocessing only). */ @@ -480,48 +474,6 @@ crash_signal (int signo) internal_error ("%s", strsignal (signo)); } -/* Arrange to dump core on error. (The regular error message is still - printed first, except in the case of abort().) */ - -static void -setup_core_dumping (void) -{ -#ifdef SIGABRT - signal (SIGABRT, SIG_DFL); -#endif -#if defined(HAVE_SETRLIMIT) - { - struct rlimit rlim; - if (getrlimit (RLIMIT_CORE, &rlim) != 0) - fatal_error ("getting core file size maximum limit: %m"); - rlim.rlim_cur = rlim.rlim_max; - if (setrlimit (RLIMIT_CORE, &rlim) != 0) - fatal_error ("setting core file size limit to maximum: %m"); - } -#endif - diagnostic_abort_on_error (global_dc); -} - - -/* Strip off a legitimate source ending from the input string NAME of - length LEN. Rather than having to know the names used by all of - our front ends, we strip off an ending of a period followed by - up to five characters. (Java uses ".class".) */ - -void -strip_off_ending (char *name, int len) -{ - int i; - for (i = 2; i < 6 && len > i; i++) - { - if (name[len - i] == '.') - { - name[len - i] = '\0'; - break; - } - } -} - /* Output a quoted string. */ void @@ -967,51 +919,6 @@ compile_file (void) targetm.asm_out.file_end (); } -/* Parse a -d... command line switch. */ - -void -decode_d_option (const char *arg) -{ - int c; - - while (*arg) - switch (c = *arg++) - { - case 'A': - flag_debug_asm = 1; - break; - case 'p': - flag_print_asm_name = 1; - break; - case 'P': - flag_dump_rtl_in_asm = 1; - flag_print_asm_name = 1; - break; - case 'v': - graph_dump_format = vcg; - break; - case 'x': - rtl_dump_and_exit = 1; - break; - case 'D': /* These are handled by the preprocessor. */ - case 'I': - case 'M': - case 'N': - case 'U': - break; - case 'H': - setup_core_dumping(); - break; - case 'a': - enable_rtl_dump_file (); - break; - - default: - warning (0, "unrecognized gcc debugging option: %c", c); - break; - } -} - /* Indexed by enum debug_info_type. */ const char *const debug_type_names[] = { -- cgit v1.2.1