aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-06-28 21:16:22 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-06-28 21:16:22 +0200
commit54bef41ddce48d42d2303839b4701d9315b2613c (patch)
tree3b47736f39c19a127986f0a91dd43566549d1706 /gcc/cpplex.c
parentd4506961cd58fde924aa6561e8896e18161b82ad (diff)
downloadgcc-54bef41ddce48d42d2303839b4701d9315b2613c.zip
gcc-54bef41ddce48d42d2303839b4701d9315b2613c.tar.gz
gcc-54bef41ddce48d42d2303839b4701d9315b2613c.tar.bz2
cpplex.c (output_line_command): Output correct #line if a header is including itself and is not protected...
* cpplex.c (output_line_command): Output correct #line if a header is including itself and is not protected against multiple inclusion. From-SVN: r34761
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index b7f6da5..6249fd7 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -289,25 +289,26 @@ output_line_command (pfile, print, line)
if (CPP_OPTION (pfile, no_line_commands))
return;
- /* Determine whether the current filename has changed, and if so,
- how. 'nominal_fname' values are unique, so they can be compared
- by comparing pointers. */
- if (ip->nominal_fname == print->last_fname)
- change = same;
- else
+ if (pfile->buffer_stack_depth == print->last_bsd)
{
- if (pfile->buffer_stack_depth == print->last_bsd)
+ /* Determine whether the current filename has changed, and if so,
+ how. 'nominal_fname' values are unique, so they can be compared
+ by comparing pointers. */
+ if (ip->nominal_fname == print->last_fname)
+ change = same;
+ else
change = rname;
+ }
+ else
+ {
+ if (pfile->buffer_stack_depth > print->last_bsd)
+ change = enter;
else
- {
- if (pfile->buffer_stack_depth > print->last_bsd)
- change = enter;
- else
- change = leave;
- print->last_bsd = pfile->buffer_stack_depth;
- }
- print->last_fname = ip->nominal_fname;
+ change = leave;
+ print->last_bsd = pfile->buffer_stack_depth;
}
+ print->last_fname = ip->nominal_fname;
+
/* If the current file has not changed, we can output a few newlines
instead if we want to increase the line number by a small amount.
We cannot do this if print->lineno is zero, because that means we