aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-opts.c15
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/cpp.c12
4 files changed, 30 insertions, 7 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index df9cdff..fb00ca9 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+011-08-22 Gabriel Charette <gchare@google.com>
+
+ * c-opts.c (c_finish_options): Force BUILTINS_LOCATION for tokens
+ defined in cpp_init_builtins and c_cpp_builtins.
+
2011-08-19 Joseph Myers <joseph@codesourcery.com>
* c-common.c (c_common_reswords): Add __builtin_complex.
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 3227f7b..49ff80d 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1306,12 +1306,17 @@ c_finish_options (void)
{
size_t i;
- cb_file_change (parse_in,
- linemap_add (line_table, LC_RENAME, 0,
- _("<built-in>"), 0));
+ {
+ /* Make sure all of the builtins about to be declared have
+ BUILTINS_LOCATION has their source_location. */
+ source_location builtins_loc = BUILTINS_LOCATION;
+ cpp_force_token_locations (parse_in, &builtins_loc);
- cpp_init_builtins (parse_in, flag_hosted);
- c_cpp_builtins (parse_in);
+ cpp_init_builtins (parse_in, flag_hosted);
+ c_cpp_builtins (parse_in);
+
+ cpp_stop_forcing_token_locations (parse_in);
+ }
/* We're about to send user input to cpplib, so make it warn for
things that we previously (when we sent it internal definitions)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 69d901e..075c366 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-22 Gabriel Charette <gchare@google.com>
+
+ * cpp.c (gfc_cpp_init): Force BUILTINS_LOCATION for tokens
+ defined in cpp_define_builtins.
+
2011-08-22 Mikael Morin <mikael.morin@gcc.gnu.org>
PR fortran/50050
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index a40442e..9368d89 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -565,9 +565,17 @@ gfc_cpp_init (void)
if (gfc_option.flag_preprocessed)
return;
- cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
if (!gfc_cpp_option.no_predefined)
- cpp_define_builtins (cpp_in);
+ {
+ /* Make sure all of the builtins about to be declared have
+ BUILTINS_LOCATION has their source_location. */
+ source_location builtins_loc = BUILTINS_LOCATION;
+ cpp_force_token_locations (cpp_in, &builtins_loc);
+
+ cpp_define_builtins (cpp_in);
+
+ cpp_stop_forcing_token_locations (cpp_in);
+ }
/* Handle deferred options from command-line. */
cpp_change_file (cpp_in, LC_RENAME, _("<command-line>"));