OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / c-pch.c
index 3fde461..b4f7050 100644 (file)
@@ -367,6 +367,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
   struct c_pch_header h;
   struct save_macro_data *smd;
   expanded_location saved_loc;
+  bool saved_trace_includes;
 
   f = fdopen (fd, "rb");
   if (f == NULL)
@@ -412,6 +413,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
 
   /* Save the location and then restore it after reading the PCH.  */
   saved_loc = expand_location (line_table->highest_line);
+  saved_trace_includes = line_table->trace_includes;
 
   cpp_prepare_state (pfile, &smd);
 
@@ -425,6 +427,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
 
   fclose (f);
 
+  line_table->trace_includes = saved_trace_includes;
   cpp_set_line_map (pfile, line_table);
   linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line);
 
@@ -460,7 +463,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name)
   if (!cpp_get_options (pfile)->preprocessed)
     {
       error ("pch_preprocess pragma should only be used with -fpreprocessed");
-      inform ("use #include instead");
+      inform (input_location, "use #include instead");
       return;
     }
 
@@ -471,7 +474,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name)
   if (c_common_valid_pch (pfile, name, fd) != 1)
     {
       if (!cpp_get_options (pfile)->warn_invalid_pch)
-       inform ("use -Winvalid-pch for more information");
+       inform (input_location, "use -Winvalid-pch for more information");
       fatal_error ("%s: PCH file was invalid", name);
     }