]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
input.c (feed_input): Only touch lineno and input_filename if !USE_CPPLIB.
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 27 Jul 1999 00:37:44 +0000 (00:37 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 27 Jul 1999 00:37:44 +0000 (20:37 -0400)
* input.c (feed_input): Only touch lineno and input_filename
if !USE_CPPLIB.  Save the old values before setting the new ones.

From-SVN: r28278

gcc/cp/ChangeLog
gcc/cp/input.c

index afa0b86e8acc769ecdcc9782d93e00ec2b83a0ca..f9469a40dc4a39bc6dbc808f40e21a9e5d409eb6 100644 (file)
@@ -1,5 +1,8 @@
 1999-07-26  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * input.c (feed_input): Only touch lineno and input_filename
+       if !USE_CPPLIB.  Save the old values before setting the new ones.
+
        * input.c (feed_input): Add file, line parms.
        * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
        (real_yylex): Check linemode before input_redirected().
index 12ad47ba52100bd145a60bea1fedc6a766168c4e..7fd97a784d278bca183042205d5a8118b468f84b 100644 (file)
@@ -51,10 +51,10 @@ struct input_source {
   /* linked list maintenance */
   struct input_source *next;
   /* values to restore after reading all of current string */
-  char *filename;
-  int lineno;
   struct pending_input *input;
 #if !USE_CPPLIB
+  char *filename;
+  int lineno;
   struct putback_buffer putback;
 #endif
 };
@@ -136,6 +136,8 @@ feed_input (str, len, file, line)
   inp->length = len;
   inp->offset = 0;
   inp->putback = putback;
+  inp->filename = input_filename;
+  inp->lineno = lineno;
   putback.buffer = NULL;
   putback.buffer_size = 0;
   putback.index = -1;
@@ -143,8 +145,6 @@ feed_input (str, len, file, line)
   input_filename = file;
 #endif
   inp->next = input;
-  inp->filename = input_filename;
-  inp->lineno = lineno;
   inp->input = save_pending_input ();
   input = inp;
 }
@@ -160,12 +160,12 @@ end_input ()
   cpp_pop_buffer (&parse_in);
 #else
   putback = inp->putback;
+  input_filename = inp->filename;
+  lineno = inp->lineno;
 #endif
 
   end_of_file = 0;
   input = inp->next;
-  input_filename = inp->filename;
-  lineno = inp->lineno;
   /* Get interface/implementation back in sync.  */
   extract_interface_info ();
   restore_pending_input (inp->input);