summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-31 19:26:17 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-31 19:26:17 +0000
commitdcfa26d9a6f914b73171fa3b6f28726a427b347a (patch)
tree1439a449d638a4d9ab3e37e56c424c1622a59ad9 /gcc/opts.c
parentea9fc63372209989200bc371d0ad1f4dfa94396d (diff)
downloadgcc-dcfa26d9a6f914b73171fa3b6f28726a427b347a.tar.gz
* opts.c (in_fnames, num_in_fnames): Moved here from c-opts.
(add_input_filename): New function. (handle_options): Call add_input_filename directly instead of with a lang hook. * opts.h (in_fnames, num_in_fnames): Moved here. (add_input_filename): Declare. * c-decl.c: Need to #include opts.h. * Makefile.in (c-decl.o): Also depends on opts.h. * c-opts.c (in_fnames, num_in_fnames): Moved to opts.c. (c_common_handle_filename): Replaced by add_input_filename. * c-common.h (in_fnames, num_in_fnames, c_common_handle_filename): Remove. * langhooks.h (struct lang_hooks): Remove handle_filename hook. * langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME): Remove macro. (LANG_HOOKS_INITIALIZER): Remove use of LANG_HOOKS_HANDLE_FILENAME. * c-lang.c (LANG_HOOKS_HANDLE_FILENAME): Remove macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 7c24921b0ab..de39e5c6c8d 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -134,6 +134,10 @@ static unsigned int columns = 80;
/* What to print when a switch has no documentation. */
static const char undocumented_msg[] = N_("This switch lacks documentation");
+/* Input file names. */
+const char **in_fnames;
+unsigned num_in_fnames;
+
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 *);
@@ -422,7 +426,7 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
if (opt[0] != '-' || opt[1] == '\0')
{
main_input_filename = opt;
- (*lang_hooks.handle_filename) (opt);
+ add_input_filename (opt);
n = 1;
continue;
}
@@ -437,6 +441,15 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
}
}
+/* Handle FILENAME from the command line. */
+void
+add_input_filename (const char *filename)
+{
+ num_in_fnames++;
+ in_fnames = xrealloc (in_fnames, num_in_fnames * sizeof (in_fnames[0]));
+ in_fnames[num_in_fnames - 1] = filename;
+}
+
/* Parse command line options and set default flag values. Do minimal
options processing. */
void