diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2000-12-17 00:13:54 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-12-17 00:13:54 +0000 |
commit | ad2a084dbd3fbcacde8a5034ef381b1ee41d09e5 (patch) | |
tree | dc9788c071208bc6125b57c49a68337f6a09eb53 /gcc/c-lex.c | |
parent | 3b67042af8f91e658c6467d3dad4464c89c069ab (diff) | |
download | gcc-ad2a084dbd3fbcacde8a5034ef381b1ee41d09e5.zip gcc-ad2a084dbd3fbcacde8a5034ef381b1ee41d09e5.tar.gz gcc-ad2a084dbd3fbcacde8a5034ef381b1ee41d09e5.tar.bz2 |
c-lex.c: Move main_input_filename handling to FC_ENTER.
* c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up.
* cpperror.c (print_containing_files): Get right line number.
(print_location): Output column of 1 if 0.
* cppfiles.c (stack_include_file): cpp_push_buffer handles
the callback.
* cpphash.h (_cpp_do_file_change): No longer external.
* cpplib.c (do_file_change): Now local to cpplib.c.
(do_line): Fake a buffer stack for preprocessed files.
(cpp_push_buffer): Create a file_change callback. Handle faked
buffers.
(cpp_pop_buffer): Similarly.
* cpplib.h: BUF_FAKE: New buffer type.
* cppmain.c: Update to handle correct file renaming where a
#line is the first line of the main file, and produce only
the renamed file, not the original file, as output.
From-SVN: r38319
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index cf65cea..13e0ef2 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -234,14 +234,10 @@ cb_change_file (pfile, fc) cpp_reader *pfile ATTRIBUTE_UNUSED; const cpp_file_change *fc; { - if (fc->from.filename == 0) - main_input_filename = fc->to.filename; - in_system_header = fc->sysp; - /* Do the actions implied by the preceding numbers. */ if (fc->reason == FC_ENTER) { - /* FIXME. Don't stack the main buffer on the input stack. */ + /* Don't stack the main buffer on the input stack. */ if (fc->from.filename) { lineno = lex_lineno; @@ -258,6 +254,8 @@ cb_change_file (pfile, fc) } #endif } + else + main_input_filename = fc->to.filename; } else if (fc->reason == FC_LEAVE) { @@ -288,11 +286,9 @@ cb_change_file (pfile, fc) else error ("leaving more files than we entered"); } - else if (fc->reason == FC_RENAME) - input_filename = fc->to.filename; update_header_times (fc->to.filename); - + in_system_header = fc->sysp; input_filename = fc->to.filename; lex_lineno = fc->to.lineno; |