diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-24 23:53:07 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-24 23:53:07 +0000 |
| commit | 9b3d66301bcad60090ee78e129bf8178692f1141 (patch) | |
| tree | 2f6029276812610822ac864fb806ed128477ad78 | |
| parent | 438cf953544e85dea69e1b2f71bd8d3f237e0fc8 (diff) | |
| download | ppe42-gcc-9b3d66301bcad60090ee78e129bf8178692f1141.tar.gz ppe42-gcc-9b3d66301bcad60090ee78e129bf8178692f1141.zip | |
* cpplib.c (do_pragma): Reintroduce cb_line_change call in the
code path that calls a handler.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71744 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cpplib.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b938b90df4..3e2d5703a65 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-09-24 Alexandre Oliva <aoliva@redhat.com> + + * cpplib.c (do_pragma): Reintroduce cb_line_change call in the + code path that calls a handler. + 2003-09-24 Nathanael Nerode <neroden@gcc.gnu.org> * config.gcc (c4x-*, tic4x-*, d30v-*, mmix-knuth-mmixware): diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 6a0f3e0d64b..5a927555468 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1120,7 +1120,7 @@ static void do_pragma (cpp_reader *pfile) { const struct pragma_entry *p = NULL; - const cpp_token *token; + const cpp_token *token, *pragma_token = pfile->cur_token; unsigned int count = 1; pfile->state.prevent_expansion++; @@ -1141,7 +1141,17 @@ do_pragma (cpp_reader *pfile) } if (p) - p->u.handler (pfile); + { + /* Since the handler below doesn't get the line number, that it + might need for diagnostics, make sure it has the right + numbers in place. */ + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pragma_token, false); + (*p->u.handler) (pfile); + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pfile->cur_token, false); + + } else if (pfile->cb.def_pragma) { _cpp_backup_tokens (pfile, count); |

