aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Brolley <brolley@cygnus.com>1998-04-08 17:30:08 -0600
committerJeff Law <law@gcc.gnu.org>1998-04-08 17:30:08 -0600
commit77f77701a5cfcced3afcab79f8b6a81e7a968c71 (patch)
tree287480fe00c954bbb3cf840cbf2654e638a03334
parente56e519de8211b657741d6e7bd5fae0db71405c9 (diff)
downloadgcc-77f77701a5cfcced3afcab79f8b6a81e7a968c71.zip
gcc-77f77701a5cfcced3afcab79f8b6a81e7a968c71.tar.gz
gcc-77f77701a5cfcced3afcab79f8b6a81e7a968c71.tar.bz2
com.c (finput): New variable.
* com.c (finput): New variable. (init_parse): Handle !USE_CPPLIB. (finish_parse): New function. (lang_init): No longer declare finput. From-SVN: r19064
-rw-r--r--gcc/f/com.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 39af54d..282a294 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -238,6 +238,9 @@ tree current_function_decl;
char *language_string = "GNU F77";
+/* Stream for reading from the input file. */
+FILE *finput;
+
/* These definitions parallel those in c-decl.c so that code from that
module can be used pretty much as is. Much of these defs aren't
otherwise used, i.e. by g77 code per se, except some of them are used
@@ -14793,12 +14796,28 @@ init_decl_processing ()
}
void
-init_lex ()
+init_parse (filename)
+ char *filename;
{
#if BUILT_FOR_270
extern void (*print_error_function) (char *);
#endif
+ /* Open input file. */
+ if (filename == 0 || !strcmp (filename, "-"))
+ {
+ finput = stdin;
+ filename = "stdin";
+ }
+ else
+ finput = fopen (filename, "r");
+ if (finput == 0)
+ pfatal_with_name (filename);
+
+#ifdef IO_BUFFER_SIZE
+ setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
+#endif
+
/* Make identifier nodes long enough for the language-specific slots. */
set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name;
@@ -14808,6 +14827,12 @@ init_lex ()
}
void
+finish_parse ()
+{
+ fclose (finput);
+}
+
+void
insert_block (block)
tree block;
{
@@ -14851,8 +14876,6 @@ lang_identify ()
void
lang_init ()
{
- extern FILE *finput; /* Don't pollute com.h with this. */
-
/* If the file is output from cpp, it should contain a first line
`# 1 "real-filename"', and the current design of gcc (toplev.c
in particular and the way it sets up information relied on by