aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 9c19410..fa01b34 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -496,6 +496,9 @@ cpp_create_reader (table, lang)
be needed. */
pfile->deps = deps_init ();
+ /* Initialise the line map. */
+ init_line_maps (&pfile->line_maps);
+
/* Initialize lexer state. */
pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments);
@@ -585,6 +588,8 @@ cpp_destroy (pfile)
free (context);
}
+ free_line_maps (&pfile->line_maps);
+
result = pfile->errors;
free (pfile);
@@ -941,6 +946,11 @@ cpp_start_read (pfile, fname)
p = q;
}
+ /* This was zero when the initial buffer was stacked; so we must
+ make up for a non-existent new line, as well as the intervening
+ macro definitions, by setting it to 1. */
+ pfile->line = 1;
+
/* The -imacros files can be scanned now, but the -include files
have to be pushed onto the buffer stack and processed later,
otherwise cppmain.c won't see the tokens. include_head was built