summaryrefslogtreecommitdiff
path: root/gcc/treelang/tree1.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-08 21:12:26 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-08 21:12:26 +0000
commit03bde6017ce5581fcb73761fa8c5210ee12631aa (patch)
tree6dbda9aef13aa04d7c15b46cb0bda16747482b8d /gcc/treelang/tree1.c
parent0d409008b0302a0de479fbe32900561a70bd37d5 (diff)
downloadgcc-03bde6017ce5581fcb73761fa8c5210ee12631aa.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64001 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/treelang/tree1.c')
-rw-r--r--gcc/treelang/tree1.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/treelang/tree1.c b/gcc/treelang/tree1.c
index 20913bafd78..e6f96d4b625 100644
--- a/gcc/treelang/tree1.c
+++ b/gcc/treelang/tree1.c
@@ -78,7 +78,7 @@ unsigned int option_lexer_trace = 0;
/* Local variables. */
-unsigned char *in_fname = NULL; /* Input file name. */
+const char *in_fname; /* Input file name. */
/* This is 1 if we have output the version string. */
@@ -179,12 +179,12 @@ treelang_decode_option (num_options_left, first_option_left)
/* Language dependent parser setup. */
-const char*
-treelang_init (const char* filename)
+bool
+treelang_init ()
{
- /* Set up the declarations needed for this front end. */
+ in_fname = main_input_filename;
- input_filename = "";
+ /* Set up the declarations needed for this front end. */
lineno = 0;
/* Init decls etc. */
@@ -193,7 +193,7 @@ treelang_init (const char* filename)
/* This error will not happen from GCC as it will always create a
fake input file. */
- if (!filename || (filename[0] == ' ') || (!filename[0]))
+ if (!in_fname || in_fname[0] == ' ' || !in_fname[0])
{
if (!version_done)
{
@@ -201,17 +201,17 @@ treelang_init (const char* filename)
exit (1);
}
- in_fname = NULL;
- return NULL;
+ return false;
}
- yyin = fopen (filename, "r");
+
+ yyin = fopen (in_fname, "r");
if (!yyin)
{
- fprintf (stderr, "Unable to open input file %s\n", filename);
+ fprintf (stderr, "Unable to open input file %s\n", in_fname);
exit (1);
}
- input_filename = filename;
- return (char*) (in_fname = (unsigned char*)filename);
+
+ return true;
}
/* Language dependent wrapup. */