aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2003-03-08 21:12:26 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-03-08 21:12:26 +0000
commit4bfec48308a39e8ba1af2ebca9cbcddfac231b22 (patch)
tree6dbda9aef13aa04d7c15b46cb0bda16747482b8d /gcc/java
parent9dd04ab53c8790dcb12aa7d4a0396a5ca58432da (diff)
downloadgcc-4bfec48308a39e8ba1af2ebca9cbcddfac231b22.zip
gcc-4bfec48308a39e8ba1af2ebca9cbcddfac231b22.tar.gz
gcc-4bfec48308a39e8ba1af2ebca9cbcddfac231b22.tar.bz2
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
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/lang.c136
2 files changed, 74 insertions, 67 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b65f0fc..163567c 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.c (java_init): Update prototype, move code to java_post_options.
+ (java_post_options): Similarly.
+
2003-03-05 Ranjit Mathew <rmathew@hotmail.com>
* jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index daa2e49..41441bf 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -53,10 +53,10 @@ struct string_option
const int on_value;
};
-static const char *java_init (const char *);
+static bool java_init (void);
static void java_finish (void);
static void java_init_options (void);
-static bool java_post_options (void);
+static bool java_post_options (const char **);
static int java_decode_option (int, char **);
static void put_decl_string (const char *, int);
@@ -508,8 +508,8 @@ java_decode_option (int argc __attribute__ ((__unused__)), char **argv)
/* Global open file. */
FILE *finput;
-static const char *
-java_init (const char *filename)
+static bool
+java_init (void)
{
#if 0
extern int flag_minimal_debug;
@@ -526,67 +526,6 @@ java_init (const char *filename)
&& force_align_functions_log < 1)
force_align_functions_log = 1;
- /* Open input file. */
-
- if (filename == 0 || !strcmp (filename, "-"))
- {
- finput = stdin;
- filename = "stdin";
-
- if (dependency_tracking)
- error ("can't do dependency tracking with input from stdin");
- }
- else
- {
- if (dependency_tracking)
- {
- char *dot;
-
- /* If the target is set and the output filename is set, then
- there's no processing to do here. Otherwise we must
- compute one or the other. */
- if (! ((dependency_tracking & DEPEND_TARGET_SET)
- && (dependency_tracking & DEPEND_FILE_ALREADY_SET)))
- {
- dot = strrchr (filename, '.');
- if (dot == NULL)
- error ("couldn't determine target name for dependency tracking");
- else
- {
- char *buf = xmalloc (dot - filename +
- 3 + sizeof (TARGET_OBJECT_SUFFIX));
- strncpy (buf, filename, dot - filename);
-
- /* If emitting class files, we might have multiple
- targets. The class generation code takes care of
- registering them. Otherwise we compute the
- target name here. */
- if ((dependency_tracking & DEPEND_TARGET_SET))
- ; /* Nothing. */
- else if (flag_emit_class_files)
- jcf_dependency_set_target (NULL);
- else
- {
- strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
- jcf_dependency_set_target (buf);
- }
-
- if ((dependency_tracking & DEPEND_FILE_ALREADY_SET))
- ; /* Nothing. */
- else if ((dependency_tracking & DEPEND_SET_FILE))
- {
- strcpy (buf + (dot - filename), ".d");
- jcf_dependency_set_dep_file (buf);
- }
- else
- jcf_dependency_set_dep_file ("-");
-
- free (buf);
- }
- }
- }
- }
-
jcf_path_init ();
jcf_path_seal (version_flag);
@@ -594,7 +533,7 @@ java_init (const char *filename)
using_eh_for_cleanups ();
- return filename;
+ return true;
}
static void
@@ -813,8 +752,10 @@ java_can_use_bit_fields_p (void)
/* Post-switch processing. */
static bool
-java_post_options (void)
+java_post_options (const char **pfilename)
{
+ const char *filename = *pfilename;
+
/* Use tree inlining if possible. Function instrumentation is only
done in the RTL level, so we disable tree inlining. */
if (! flag_instrument_function_entry_exit)
@@ -828,6 +769,67 @@ java_post_options (void)
}
}
+ /* Open input file. */
+
+ if (filename == 0 || !strcmp (filename, "-"))
+ {
+ finput = stdin;
+ filename = "stdin";
+
+ if (dependency_tracking)
+ error ("can't do dependency tracking with input from stdin");
+ }
+ else
+ {
+ if (dependency_tracking)
+ {
+ char *dot;
+
+ /* If the target is set and the output filename is set, then
+ there's no processing to do here. Otherwise we must
+ compute one or the other. */
+ if (! ((dependency_tracking & DEPEND_TARGET_SET)
+ && (dependency_tracking & DEPEND_FILE_ALREADY_SET)))
+ {
+ dot = strrchr (filename, '.');
+ if (dot == NULL)
+ error ("couldn't determine target name for dependency tracking");
+ else
+ {
+ char *buf = xmalloc (dot - filename +
+ 3 + sizeof (TARGET_OBJECT_SUFFIX));
+ strncpy (buf, filename, dot - filename);
+
+ /* If emitting class files, we might have multiple
+ targets. The class generation code takes care of
+ registering them. Otherwise we compute the
+ target name here. */
+ if ((dependency_tracking & DEPEND_TARGET_SET))
+ ; /* Nothing. */
+ else if (flag_emit_class_files)
+ jcf_dependency_set_target (NULL);
+ else
+ {
+ strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
+ jcf_dependency_set_target (buf);
+ }
+
+ if ((dependency_tracking & DEPEND_FILE_ALREADY_SET))
+ ; /* Nothing. */
+ else if ((dependency_tracking & DEPEND_SET_FILE))
+ {
+ strcpy (buf + (dot - filename), ".d");
+ jcf_dependency_set_dep_file (buf);
+ }
+ else
+ jcf_dependency_set_dep_file ("-");
+
+ free (buf);
+ }
+ }
+ }
+ }
+
/* Initialize the compiler back end. */
return false;
}