diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-02 20:15:46 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-02 20:15:46 +0000 |
commit | 4838a8b60e7c994c9b593ea916a32003facba970 (patch) | |
tree | 9c89fbb7a4fe5df7e431edc8e3aadca6bfb3b1de /gcc/opts.c | |
parent | 16a087ae82d5cab9d038339ba936a450f5d22fe2 (diff) | |
download | gcc-4838a8b60e7c994c9b593ea916a32003facba970.tar.gz |
* c-common.h (c_common_init_options): New prototype.
* c-opts.c (deferred_size): Remove.
(defer_opt): Array is now pre-allocated.
(c_common_init_options): Pre-allocate deferred_opts. Make
lang_flags unsigned.
(push_command_line_options): Free deferred_opts.
* hooks.c (hook_uint_uint_constcharptrptr_0): New.
* hooks.h (hook_uint_uint_constcharptrptr_0): New.
* langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): Update.
* langhooks.h (struct lang_hooks): New prototype for init_options.
* main.c (main): Cast argv.
* opts.c (handle_option, handle_options): Update prototypes.
(decode_options): save_argc, save_argv are not global. Constify.
* opts.h (decode_options): New prototype.
* toplev.c (general_init): New protoype.
(save_argv): Make static.
(save_argc): Remove.
(print_switch_values, general_init): Constify.
(toplev_main): Save argv.
* toplev.h (toplev_main): Update prototype.
(save_argc, save_argv): Remove.
ada:
* misc.c (save_argc, save_argv): Make static.
(gnat_init_options): New prototype.
(gnat_init_options): Update.
f:
* top.c (ffe_init_options): Update prototype.
* top.h (ffe_init_options): Update prototype.
java:
* lang.c (java_init_options): Update prototype.
treelang:
* tree1.c (treelang_init_options): Update prototype.
* treelang.h (treelang_init_options): Update prototype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68850 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/opts.c b/gcc/opts.c index a150c3afa91..3f3cc13ae03 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -131,11 +131,11 @@ static size_t find_opt (const char *, int); static int common_handle_option (size_t scode, const char *arg, int value); static void handle_param (const char *); static void set_Wextra (int); -static unsigned int handle_option (char **argv, unsigned int lang_mask); +static unsigned int handle_option (const char **argv, unsigned int lang_mask); static char *write_langs (unsigned int lang_mask); static void complain_wrong_lang (const char *, const struct cl_option *, unsigned int lang_mask); -static void handle_options (unsigned int, char **, unsigned int lang_mask); +static void handle_options (unsigned int, const char **, unsigned int); /* Perform a binary search to find which option the command-line INPUT matches. Returns its index in the option array, and N_OPTS @@ -286,7 +286,7 @@ complain_wrong_lang (const char *text, const struct cl_option *option, /* Handle the switch beginning at ARGV for the language indicated by LANG_MASK. Returns the number of switches consumed. */ static unsigned int -handle_option (char **argv, unsigned int lang_mask) +handle_option (const char **argv, unsigned int lang_mask) { size_t opt_index; const char *opt, *arg = 0; @@ -408,7 +408,7 @@ handle_option (char **argv, unsigned int lang_mask) contains has a single bit set representing the current language. */ static void -handle_options (unsigned int argc, char **argv, unsigned int lang_mask) +handle_options (unsigned int argc, const char **argv, unsigned int lang_mask) { unsigned int n, i; @@ -427,16 +427,12 @@ handle_options (unsigned int argc, char **argv, unsigned int lang_mask) /* Parse command line options and set default flag values. Do minimal options processing. */ void -decode_options (int argc, char **argv) +decode_options (unsigned int argc, const char **argv) { - int i, lang_mask; - - /* Save in case md file wants to emit args as a comment. */ - save_argc = argc; - save_argv = argv; + unsigned int i, lang_mask; /* Perform language-specific options initialization. */ - lang_mask = (*lang_hooks.init_options) (); + lang_mask = (*lang_hooks.init_options) (argc, argv); /* Scan to see what optimization level has been specified. That will determine the default value of many flags. */ @@ -450,7 +446,7 @@ decode_options (int argc, char **argv) else if (argv[i][0] == '-' && argv[i][1] == 'O') { /* Handle -Os, -O2, -O3, -O69, ... */ - char *p = &argv[i][2]; + const char *p = &argv[i][2]; if ((p[0] == 's') && (p[1] == 0)) { |