c-lex.c (cb_def_pragma): Clean up code for making location palatable to diagnostic.c.
authorZack Weinberg <zack@gcc.gnu.org>
Wed, 27 Oct 2004 17:24:20 +0000 (17:24 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Wed, 27 Oct 2004 17:24:20 +0000 (17:24 +0000)
* c-lex.c (cb_def_pragma): Clean up code for making location
palatable to diagnostic.c.

From-SVN: r89691

gcc/ChangeLog
gcc/c-lex.c

index 92d127a..9102abc 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-27  Zack Weinberg  <zack@codesourcery.com>
+
+       * c-lex.c (cb_def_pragma): Clean up code for making location
+       palatable to diagnostic.c.
+
 2004-10-27  Steven Bosscher  <stevenb@suse.de>
 
        PR tree-optimization/17757
@@ -25,7 +30,7 @@
            patch originally created by Kelley Cook  <kcook@gcc.gnu.org>
 
        PR middle-end/14684
-       * opts.c (OPT_fprofile_generate): Default to -funroll-loops 
+       * opts.c (OPT_fprofile_generate): Default to -funroll-loops
        to match -fprofile-use.
 
 2004-10-27  Kazu Hirata  <kazu@cs.umass.edu>
index 415785d..f5425ce 100644 (file)
@@ -283,11 +283,16 @@ cb_def_pragma (cpp_reader *pfile, source_location loc)
      -Wunknown-pragmas has been given.  */
   if (warn_unknown_pragmas > in_system_header)
     {
+      const unsigned char *space, *name;
+      const cpp_token *s;
 #ifndef USE_MAPPED_LOCATION
+      location_t fe_loc;
       const struct line_map *map = linemap_lookup (&line_table, loc);
+      fe_loc.file = map->to_file;
+      fe_loc.line = SOURCE_LINE (map, loc);
+#else
+      location_t fe_loc = loc;
 #endif
-      const unsigned char *space, *name;
-      const cpp_token *s;
 
       space = name = (const unsigned char *) "";
       s = cpp_get_token (pfile);
@@ -299,12 +304,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc)
            name = cpp_token_as_text (pfile, s);
        }
 
-#ifdef USE_MAPPED_LOCATION
-      input_location = loc;
-#else
-      input_line = SOURCE_LINE (map, loc);
-#endif
-      warning ("ignoring #pragma %s %s", space, name);
+      warning ("%Hignoring #pragma %s %s", &fe_loc, space, name);
     }
 }