diff options
author | Neil Booth <neil@cat.daikokuya.demon.co.uk> | 2001-08-01 06:19:39 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-08-01 06:19:39 +0000 |
commit | 1444f2ed7cfaf30f6e50da21f9a74e164f1fad84 (patch) | |
tree | 31a44a63f5280d362281e3aedf7c120f4aed024a /gcc/cppmacro.c | |
parent | 7f8a212577aa9bc71a1828635b426c3f2157c3b6 (diff) | |
download | gcc-1444f2ed7cfaf30f6e50da21f9a74e164f1fad84.zip gcc-1444f2ed7cfaf30f6e50da21f9a74e164f1fad84.tar.gz gcc-1444f2ed7cfaf30f6e50da21f9a74e164f1fad84.tar.bz2 |
cpphash.h (struct cpp_reader): New members line, pseudo_newlines.
* cpphash.h (struct cpp_reader): New members line, pseudo_newlines.
* cpplex.c (handle_newline): Update prototype. Maintain logical
line number.
(skip_escaped_newlines, skip_block_comment, parse_string):
Update accordingly.
(_cpp_lex_token): Update, and store token position within the token.
* cpplib.h (struct cpp_token): Add line and column entries.
* cppmacro.c (replace_args): Position stringified tokens correctly.
From-SVN: r44533
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index a4569a3e..f8b3a2b 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -761,7 +761,12 @@ replace_args (pfile, macro, args, list) arg = &args[src->val.arg_no - 1]; if (src->flags & STRINGIFY_ARG) - from = arg->stringified, count = 1; + { + from = arg->stringified, count = 1; + /* Ugh. Maintain position of original argument. */ + arg->stringified->line = src->line; + arg->stringified->col = src->col; + } else if (src->flags & PASTE_LEFT) count = arg->count, from = arg->first; else if (src > macro->expansion && (src[-1].flags & PASTE_LEFT)) @@ -923,6 +928,7 @@ cpp_get_token (pfile, token) /* PASTE_LEFT tokens can only appear in macro expansions. */ if (token->flags & PASTE_LEFT) { + /* Maintains position of original token. */ paste_all_tokens (pfile, token); pfile->buffer->saved_flags = AVOID_LPASTE; } @@ -957,6 +963,7 @@ cpp_get_token (pfile, token) if (node->flags & NODE_BUILTIN) { + /* Maintains position of original token. */ builtin_macro (pfile, token); pfile->buffer->saved_flags = AVOID_LPASTE; break; |