aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-09-15 10:18:03 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-09-15 10:18:03 +0000
commit5041042620988be8180d56e808f8efe66c56c79b (patch)
tree8e0d501bff80d035729518382d4a712cf34238c5 /gcc/cppmacro.c
parent6131fd23f505853e49b7f394b2dcb5de50076ad1 (diff)
downloadgcc-5041042620988be8180d56e808f8efe66c56c79b.zip
gcc-5041042620988be8180d56e808f8efe66c56c79b.tar.gz
gcc-5041042620988be8180d56e808f8efe66c56c79b.tar.bz2
cpphash.h (struct cpp_reader): Remove lexer_pos, directive_pos.
* cpphash.h (struct cpp_reader): Remove lexer_pos, directive_pos. Split mlstring_pos into mls_line and mls_col. * cppinit.c (cpp_create_reader): Initialize line to 1. (cpp_destroy): Free tokenruns. (push_include): Don't update lexer_pos. * cpplex.c (unterminated, parse_string): Update. (lex_token): Don't update lexer_pos, update. * cpplib.c (if_stack): Save line instead of line + col. (start_directive, _cpp_do__Pragma, do_else, do_elif, push_conditional, _cpp_pop_buffer): Update. * cppmacro.c (funlike_invocation_p): Don't save lexer_pos. (_cpp_create_definition): Update. From-SVN: r45627
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 61abc4a..5c64767 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -605,9 +605,7 @@ funlike_invocation_p (pfile, node, list)
{
cpp_token maybe_paren;
macro_arg *args = 0;
- cpp_lexer_pos macro_pos;
- macro_pos = pfile->lexer_pos;
pfile->state.parsing_args = 1;
pfile->state.prevent_expansion++;
@@ -630,10 +628,6 @@ funlike_invocation_p (pfile, node, list)
pfile->state.parsing_args = 0;
pfile->keep_tokens--;
- /* Reset the position in case of failure. If success, the macro's
- expansion appears where the name would have. */
- pfile->lexer_pos = macro_pos;
-
if (args)
{
if (node->value.macro->paramc > 0)
@@ -1247,7 +1241,7 @@ _cpp_create_definition (pfile, node)
macro = (cpp_macro *) _cpp_pool_alloc (&pfile->macro_pool,
sizeof (cpp_macro));
- macro->line = pfile->directive_pos.line;
+ macro->line = pfile->directive_line;
macro->params = 0;
macro->paramc = 0;
macro->fun_like = 0;
@@ -1345,8 +1339,7 @@ _cpp_create_definition (pfile, node)
{
if (warn_of_redefinition (pfile, node, macro))
{
- cpp_pedwarn_with_line (pfile, pfile->directive_pos.line,
- pfile->directive_pos.col,
+ cpp_pedwarn_with_line (pfile, pfile->directive_line, 0,
"\"%s\" redefined", NODE_NAME (node));
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))