diff options
author | Per Bothner <per@bothner.com> | 2005-03-11 22:37:46 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2005-03-11 22:37:46 -0800 |
commit | 6037d88d58ffcacc4ee354f4300910589dc5ce47 (patch) | |
tree | 65b4a8dab5e3ade6d18469d0c871b15a2a066e5a /gcc/c-decl.c | |
parent | 210e185272bc34731909e0a53fb982d3ae434516 (diff) | |
download | gcc-6037d88d58ffcacc4ee354f4300910589dc5ce47.zip gcc-6037d88d58ffcacc4ee354f4300910589dc5ce47.tar.gz gcc-6037d88d58ffcacc4ee354f4300910589dc5ce47.tar.bz2 |
c-tree.h (struct c_declarator): New id_loc field.
* 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.
From-SVN: r96329
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 42f8bad..070a94b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4584,6 +4584,7 @@ grokdeclarator (const struct c_declarator *declarator, } decl = build_decl (VAR_DECL, declarator->u.id, type); + DECL_SOURCE_LOCATION (decl) = declarator->id_loc; if (size_varies) C_DECL_VARIABLE_SIZE (decl) = 1; @@ -6709,6 +6710,8 @@ build_id_declarator (tree ident) ret->kind = cdk_id; ret->declarator = 0; ret->u.id = ident; + /* Default value - may get reset to a more precise location. */ + ret->id_loc = input_location; return ret; } |