Commit 809a5db6 by Jason Merrill Committed by Jason Merrill

input.c (feed_input): Only touch lineno and input_filename if !USE_CPPLIB.

	* 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
parent cc7fd398
1999-07-26 Jason Merrill <jason@yorick.cygnus.com> 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. * input.c (feed_input): Add file, line parms.
* lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust. * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
(real_yylex): Check linemode before input_redirected(). (real_yylex): Check linemode before input_redirected().
......
...@@ -51,10 +51,10 @@ struct input_source { ...@@ -51,10 +51,10 @@ struct input_source {
/* linked list maintenance */ /* linked list maintenance */
struct input_source *next; struct input_source *next;
/* values to restore after reading all of current string */ /* values to restore after reading all of current string */
char *filename;
int lineno;
struct pending_input *input; struct pending_input *input;
#if !USE_CPPLIB #if !USE_CPPLIB
char *filename;
int lineno;
struct putback_buffer putback; struct putback_buffer putback;
#endif #endif
}; };
...@@ -136,6 +136,8 @@ feed_input (str, len, file, line) ...@@ -136,6 +136,8 @@ feed_input (str, len, file, line)
inp->length = len; inp->length = len;
inp->offset = 0; inp->offset = 0;
inp->putback = putback; inp->putback = putback;
inp->filename = input_filename;
inp->lineno = lineno;
putback.buffer = NULL; putback.buffer = NULL;
putback.buffer_size = 0; putback.buffer_size = 0;
putback.index = -1; putback.index = -1;
...@@ -143,8 +145,6 @@ feed_input (str, len, file, line) ...@@ -143,8 +145,6 @@ feed_input (str, len, file, line)
input_filename = file; input_filename = file;
#endif #endif
inp->next = input; inp->next = input;
inp->filename = input_filename;
inp->lineno = lineno;
inp->input = save_pending_input (); inp->input = save_pending_input ();
input = inp; input = inp;
} }
...@@ -160,12 +160,12 @@ end_input () ...@@ -160,12 +160,12 @@ end_input ()
cpp_pop_buffer (&parse_in); cpp_pop_buffer (&parse_in);
#else #else
putback = inp->putback; putback = inp->putback;
input_filename = inp->filename;
lineno = inp->lineno;
#endif #endif
end_of_file = 0; end_of_file = 0;
input = inp->next; input = inp->next;
input_filename = inp->filename;
lineno = inp->lineno;
/* Get interface/implementation back in sync. */ /* Get interface/implementation back in sync. */
extract_interface_info (); extract_interface_info ();
restore_pending_input (inp->input); restore_pending_input (inp->input);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment