From mboxrd@z Thu Jan 1 00:00:00 1970 From: neil@gcc.gnu.org To: neil@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: preprocessor/3081 Date: Sun, 05 Aug 2001 10:36:00 -0000 Message-id: <20010805173600.5216.qmail@sourceware.cygnus.com> X-SW-Source: 2001-08/msg00094.html List-Id: The following reply was made to PR preprocessor/3081; it has been noted by GNATS. From: neil@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: preprocessor/3081 Date: 5 Aug 2001 17:31:25 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: neil@gcc.gnu.org 2001-08-05 10:31:25 Modified files: gcc : c-lex.c cpperror.c cppfiles.c cpphash.h cppinit.c cpplex.c cpplib.c cppmacro.c cppmain.c line-map.h ChangeLog gcc/testsuite/gcc.dg/cpp: 19951025-1.c directiv.c gcc/testsuite : ChangeLog Log message: PR preprocessor/3081 * c-lex.c (map): New. (cb_file_change): Update map and use it. (cb_def_pragma, cb_define, cb_undef): Use map and line. (c_lex): Update to use map. * cpperror.c (print_location): Move to using logical line numbers. * cppfiles.c (stack_include_file): Update for new _cpp_do_file_change. (cpp_make_system_header): Similarly. (_cpp_execute_include): Stop line numbering hacks. Store the line we will return to. * cpphash.h (CPP_BUF_LINE): Remove. (struct cpp_buffer): Remove lineno and pseudo_newlines. Add map and return_to_line. (_cpp_do_file_change): Update. * cppinit.c (cpp_start_read): Update line kludge. * cpplex.c (handle_newline): Don't update lineno and pseudo_newlines. (trigraph_ok): Use logical line numbers for diagnostics. (skip_block_comment): Likewise. (skip_whitespace): Likewise. (skip_line_comment): Use pfile->line instead. (_cpp_lex_token): Update to use logical line numbering exclusively. Handle BOL locally. Accept new lines in directives, but keep pfile->line decremented. Diagnostics use logical lines. Update directive handling. * cpplib.c (SEEN_EOL): New. (skip_rest_of_line, check_eol): Use it. (end_directive): Increase line number when accepting the newline at the end of a directive. (run_directive): Simplify. (do_line): Bad LC_LEAVEs become LC_RENAMEs. Update. (_cpp_do_file_change): Update to take buffer line number as an argument, and store the current map in the cpp_reader. Remove line number kludges. (_cpp_do__Pragma): Restore output position after a _Pragma. (cpp_push_buffer): Don't set output line or lineno. (_cpp_pop_buffer): Transfer more info from a faked buffer. Remove line kludge. Set output_line. * cppmacro.c (builtin_macro): Update handling of __LINE__. (parse_arg): Use logical lines. (save_lookahead_token): Save EOFs too now. * cppmain.c (struct printer): Fix comments. (printer_init): Simplify, let caller do errors. (scan_translation_unit, check_multiline_token, dump_macro): Update. (maybe_print_line): Simplify. (print_line): Don't print a linemarker if -P. (cb_define, cb_undef, cb_def_pragma, cb_ident, cb_include): Update. (cb_file_change): Simplify. * line-map.h (LAST_SOURCE_LINE): Fix. (CURRENT_LINE_MAP): New. * gcc.dg/cpp/19951025-1.c: Revert. * gcc.dg/cpp/directiv.c: We no longer process directives that interrupt macro arguments. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-lex.c.diff?cvsroot=gcc&r1=1.147&r2=1.148 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpperror.c.diff?cvsroot=gcc&r1=1.48&r2=1.49 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppfiles.c.diff?cvsroot=gcc&r1=1.122&r2=1.123 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpphash.h.diff?cvsroot=gcc&r1=1.112&r2=1.113 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppinit.c.diff?cvsroot=gcc&r1=1.167&r2=1.168 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplex.c.diff?cvsroot=gcc&r1=1.151&r2=1.152 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplib.c.diff?cvsroot=gcc&r1=1.261&r2=1.262 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmacro.c.diff?cvsroot=gcc&r1=1.58&r2=1.59 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmain.c.diff?cvsroot=gcc&r1=1.71&r2=1.72 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/line-map.h.diff?cvsroot=gcc&r1=1.2&r2=1.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.10914&r2=1.10915 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/19951025-1.c.diff?cvsroot=gcc&r1=1.3&r2=1.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/cpp/directiv.c.diff?cvsroot=gcc&r1=1.3&r2=1.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.1313&r2=1.1314