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
This commit is contained in:
Gabriel Charette 2011-08-22 20:41:07 +00:00 committed by Gabriel Charette
parent c4831cff11
commit e3dfef44ef
9 changed files with 72 additions and 9 deletions

View file

@ -223,6 +223,9 @@ cpp_create_reader (enum c_lang lang, hash_table *table,
/* Initialize table for push_macro/pop_macro. */
pfile->pushed_macros = 0;
/* Do not force token locations by default. */
pfile->forced_token_location_p = NULL;
/* The expression parser stack. */
_cpp_expand_op_stack (pfile);