From 6342afacd2014efb6aede7e7b7f978dc95371a30 Mon Sep 17 00:00:00 2001 From: bothner Date: Sat, 12 Mar 2005 06:37:46 +0000 Subject: * c-tree.h (struct c_declarator): New id_loc field. * c-pragma.h (c_lex_with_flags): Take position reference. * c-lex.c (c_lex_with_flags): Set passed-in location from cpp token, iff USE_MAPPED_LOCATION. (Type doesn't match otherwise.) (c_lex): Pass dummy location to c_lex_with_flags. * c-parser.c (c_lex_one_token): Set c_token's location using c_lex_with_flags, instead of input_location, which might be "ahead". (c_parser_direct_declarator): Set declarator's id_loc from c_token's id_loc. * c-decl.c (grokdeclarator): Set DECL_SOURCE_LOCATION from declarator's id_loc, rather than probably-imprecise input_location. (build_id_declarator): Initialize c_declarator's id_loc field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96329 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/c-parser.c') diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 94874226514..6fd09b94be0 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -295,8 +295,7 @@ static void c_lex_one_token (c_token *token) { timevar_push (TV_LEX); - token->type = c_lex (&token->value); - token->location = input_location; + token->type = c_lex_with_flags (&token->value, &token->location, NULL); token->in_system_header = in_system_header; switch (token->type) { @@ -2179,6 +2178,7 @@ c_parser_direct_declarator (c_parser *parser, bool type_seen_p, c_dtr_syn kind, struct c_declarator *inner = build_id_declarator (c_parser_peek_token (parser)->value); *seen_id = true; + inner->id_loc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); return c_parser_direct_declarator_inner (parser, *seen_id, inner); } -- cgit v1.2.1