diff options
author | gchare <gchare@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-22 20:41:07 +0000 |
---|---|---|
committer | gchare <gchare@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-22 20:41:07 +0000 |
commit | 6ea2c7a39e48b9b78626cec92b83a0a6e9b05f9f (patch) | |
tree | edc710dc37d6c755bf80f2e8489e337aeb7186da /libcpp/internal.h | |
parent | c3271fdb04f8f85e05e726ce72dc99c5dd82094c (diff) | |
download | gcc-6ea2c7a39e48b9b78626cec92b83a0a6e9b05f9f.tar.gz |
Add ability to force lexed tokens' source_locations.
Use it to force BUILTINS_LOCATION when declaring builtins instead of creating a <built-in> entry in the line_table which is wrong.
* c-opts.c (c_finish_options): Force BUILTINS_LOCATION for tokens
defined in cpp_init_builtins and c_cpp_builtins.
gcc/fortran/ChangeLog
* cpp.c (gfc_cpp_init): Force BUILTINS_LOCATION for tokens
defined in cpp_define_builtins.
libcpp/ChangeLog
* init.c (cpp_create_reader): Inititalize forced_token_location_p.
* internal.h (struct cpp_reader): Add field forced_token_location_p.
* lex.c (_cpp_lex_direct): Use forced_token_location_p.
(cpp_force_token_locations): New.
(cpp_stop_forcing_token_locations): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177973 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r-- | libcpp/internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h index d2872c4a11f..6c423f056bc 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -499,6 +499,10 @@ struct cpp_reader /* List of saved macros by push_macro. */ struct def_pragma_macro *pushed_macros; + + /* If non-null, the lexer will use this location for the next token + instead of getting a location from the linemap. */ + source_location *forced_token_location_p; }; /* Character classes. Based on the more primitive macros in safe-ctype.h. |