aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2003-07-02 20:15:46 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-07-02 20:15:46 +0000
commitb86f6cd9ab108f1fda89c4fb00b0b16931182041 (patch)
tree9c89fbb7a4fe5df7e431edc8e3aadca6bfb3b1de /gcc/toplev.c
parent41ba4c4632751678d7c32b169da1ff40c39bfb9e (diff)
downloadgcc-b86f6cd9ab108f1fda89c4fb00b0b16931182041.zip
gcc-b86f6cd9ab108f1fda89c4fb00b0b16931182041.tar.gz
gcc-b86f6cd9ab108f1fda89c4fb00b0b16931182041.tar.bz2
c-common.h (c_common_init_options): New prototype.
* 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. From-SVN: r68850
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index da514a2..2f83d68 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -104,7 +104,7 @@ extern tree last_assemble_variable_decl;
extern void reg_alloc (void);
-static void general_init (char *);
+static void general_init (const char *);
static void do_compile (void);
static void process_options (void);
static void backend_init (void);
@@ -172,9 +172,8 @@ static bool no_backend;
const char *progname;
-/* Copy of arguments to toplev_main. */
-int save_argc;
-char **save_argv;
+/* Copy of argument vector to toplev_main. */
+static const char **save_argv;
/* Name of top-level original source file (what was input to cpp).
This comes from the #-command at the beginning of the actual input.
@@ -4408,7 +4407,7 @@ print_switch_values (FILE *file, int pos, int max,
const char *indent, const char *sep, const char *term)
{
size_t j;
- char **p;
+ const char **p;
/* Fill in the -frandom-seed option, if the user didn't pass it, so
that it can be printed below. This helps reproducibility. Of
@@ -4537,9 +4536,9 @@ init_asm_output (const char *name)
options are parsed. Signal handlers, internationalization etc.
ARGV0 is main's argv[0]. */
static void
-general_init (char *argv0)
+general_init (const char *argv0)
{
- char *p;
+ const char *p;
p = argv0 + strlen (argv0);
while (p != argv0 && !IS_DIR_SEPARATOR (p[-1]))
@@ -4975,8 +4974,10 @@ do_compile (void)
It is not safe to call this function more than once. */
int
-toplev_main (int argc, char **argv)
+toplev_main (unsigned int argc, const char **argv)
{
+ save_argv = argv;
+
/* Initialization of GCC's environment, and diagnostics. */
general_init (argv[0]);