diff options
author | Gabriel Charette <gchare@google.com> | 2011-08-22 20:41:07 +0000 |
---|---|---|
committer | Gabriel Charette <gchare@gcc.gnu.org> | 2011-08-22 20:41:07 +0000 |
commit | e3dfef44ef6b735ac7eea4202152d672ea0a91ef (patch) | |
tree | edc710dc37d6c755bf80f2e8489e337aeb7186da /libcpp/include | |
parent | c4831cff11fca2cee74ea2d039070a9507f13779 (diff) | |
download | gcc-e3dfef44ef6b735ac7eea4202152d672ea0a91ef.zip gcc-e3dfef44ef6b735ac7eea4202152d672ea0a91ef.tar.gz gcc-e3dfef44ef6b735ac7eea4202152d672ea0a91ef.tar.bz2 |
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.
From-SVN: r177973
Diffstat (limited to 'libcpp/include')
-rw-r--r-- | libcpp/include/cpplib.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 4d68fa7..0e90821 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -989,4 +989,8 @@ extern void cpp_prepare_state (cpp_reader *, struct save_macro_data **); extern int cpp_read_state (cpp_reader *, const char *, FILE *, struct save_macro_data *); +/* In lex.c */ +extern void cpp_force_token_locations (cpp_reader *, source_location *); +extern void cpp_stop_forcing_token_locations (cpp_reader *); + #endif /* ! LIBCPP_CPPLIB_H */ |