summaryrefslogtreecommitdiffstats
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 22:02:39 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 22:02:39 +0000
commit6e04daf1453c7f763647be12ad9123fdb4b9e385 (patch)
treee807c23671fa4dd53228ec168fcfa7e99628f896 /gcc/cpplex.c
parent20de033908c0f2ec1f09c7d5d56db3d24c222dd5 (diff)
downloadppe42-gcc-6e04daf1453c7f763647be12ad9123fdb4b9e385.tar.gz
ppe42-gcc-6e04daf1453c7f763647be12ad9123fdb4b9e385.zip
* cpphash.h (struct cpp_buffer): Restore return_at_eof field. This
partly reverts my 2003-10-01 change, because we're back to logically including <command line> inside the main line. * cpplex.c (_cpp_get_fresh_line): Check return_at_eof field. * cppmacro.c (cpp_scan_nooutput): Set return_at_eof of current buffer. Fixes PR preprocessor/14103. * cppfiles.c (_cpp_stack_include): When appropriate decrement line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION. (cpp_push_include): Don't need to increment pfile's line field. * line-map.h (LAST_SOURCE_LINE_LOCATION): Only decrement by 1. * c-ppoutput.c (print struct): New first_time field. (init_pp_output): Set print.first_time. (pp_file_change): Use print.first_time, rather than MAIN_FILE_P, which is set also for (say) <command line>. Clear print.first_time. * cppfiles.c (struct _cpp_file): Comment and type for pch field does not match the code, so fix both. (should_stack_file): Inline include_pch_p function. (include_pch_p): Remove pointless function. * cpphash.h (struct cpp_buffer): Remove unused search_cached field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 27ef0ee4441..9912aac559c 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -747,6 +747,8 @@ _cpp_lex_token (cpp_reader *pfile)
bool
_cpp_get_fresh_line (cpp_reader *pfile)
{
+ int return_at_eof;
+
/* We can't get a new line until we leave the current directive. */
if (pfile->state.in_directive)
return false;
@@ -779,9 +781,10 @@ _cpp_get_fresh_line (cpp_reader *pfile)
CPP_BUF_COLUMN (buffer, buffer->cur),
"no newline at end of file");
}
-
+
+ return_at_eof = buffer->return_at_eof;
_cpp_pop_buffer (pfile);
- if (pfile->buffer == NULL)
+ if (pfile->buffer == NULL || return_at_eof)
return false;
}
}
OpenPOWER on IntegriCloud