summaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-06 21:07:41 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-06 21:07:41 +0000
commitbd507c05c4b80c10844cdacac547bca837686b52 (patch)
tree31a1005e7788f3f63227ac0f3097f1ff9111a46e /gcc/cppmain.c
parentc6e2ff2063e0087a87cff9af0a8809c350318572 (diff)
downloadgcc-bd507c05c4b80c10844cdacac547bca837686b52.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44670 138bc75d-0d04-0410-961f-82ee72b054a4
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 86d245ab9f1..978c6447b57 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)