aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-08-06 21:07:41 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-08-06 21:07:41 +0000
commitfde84349bec539f5e49273d4e05465b52c6aa7e6 (patch)
tree31a1005e7788f3f63227ac0f3097f1ff9111a46e /gcc/cppmain.c
parentdf4556a3aaebc1b9e4da76be5ad806c431653eb8 (diff)
downloadgcc-fde84349bec539f5e49273d4e05465b52c6aa7e6.zip
gcc-fde84349bec539f5e49273d4e05465b52c6aa7e6.tar.gz
gcc-fde84349bec539f5e49273d4e05465b52c6aa7e6.tar.bz2
cpperror.c (print_containing_files): Moved to line-map.c.
* cpperror.c (print_containing_files): Moved to line-map.c. (print_location): line-map.c handles re-listing or otherwise. * cpphash.h (struct lexer_state): Remove next_bol. (struct cpp_buffer): Remove include_stack_listed. * cpplib.c (do_line, cpp_push_buffer, _cpp_pop_buffer): Remove faked buffer handling. (_cpp_do_file_change): Tweak. * cpplib.h (enum cpp_buffer_type): Remove BUF_FAKE. * cppmain.c (struct printer): Remove filename. (print_line, cb_file_change): Update accordingly. * line-map.c: Include intl.h. (init_line_maps): Initialize last_listed. (free_line_maps): Sanity check, warn if ENABLED_CHECKING. (add_line_map): Sanity check inputs, warn if ENABLED_CHECKING. (print_containing_files): New. * line-map.h (struct line_maps): New member last_listed. (print_containing_files, INCLUDED_FROM): New. * Makefile.in: Update. * po/POTFILES.in: Add line-map.c. From-SVN: r44670
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r--gcc/cppmain.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index 86d245a..978c644 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -31,7 +31,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct printer
{
FILE *outf; /* Stream to write to. */
- const char *filename; /* Name of current file. */
const char *syshdr_flags; /* System header flags, if any. */
unsigned int line; /* Line currently being written. */
unsigned char printed; /* Nonzero if something output at line. */
@@ -81,8 +80,7 @@ main (argc, argv)
do_preprocessing (argc, argv);
- /* Call to cpp_destroy () omitted for performance reasons. */
- if (cpp_errors (pfile))
+ if (cpp_destroy (pfile))
return FATAL_EXIT_CODE;
return SUCCESS_EXIT_CODE;
@@ -328,7 +326,7 @@ print_line (line, special_flags)
if (! options->no_line_commands)
fprintf (print.outf, "# %u \"%s\"%s%s\n",
SOURCE_LINE (print.map, print.line),
- print.filename, special_flags, print.syshdr_flags);
+ print.map->to_file, special_flags, print.syshdr_flags);
}
/* Callbacks. */
@@ -400,7 +398,6 @@ cb_file_change (pfile, fc)
maybe_print_line (fc->line - 1);
print.map = fc->map;
- print.filename = fc->map->to_file;
if (fc->externc)
print.syshdr_flags = " 3 4";
else if (fc->sysp)