re PR fortran/33528 (Wrong locations emitted with mapped locations and included files)
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 22 Sep 2007 23:48:02 +0000 (23:48 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 22 Sep 2007 23:48:02 +0000 (23:48 +0000)
PR fortran/33528
* scanner.c (preprocessor_line): Call linemap_add when exiting
a file.
(gfc_new_file): Adjust debug code for USE_MAPPED_LOCATION.

From-SVN: r128676

gcc/fortran/ChangeLog
gcc/fortran/scanner.c

index 3c85cdd754af101f42a79b2988f81b0dcced27ae..327cc7a6420b60d8bba53849f2a007ad175e3234 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-23  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/33528
+       * scanner.c (preprocessor_line): Call linemap_add when exiting
+       a file.
+       (gfc_new_file): Adjust debug code for USE_MAPPED_LOCATION.
+
 2007-09-22  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/33522
index ef2bbcd921e2cf4ecc14646f1b11bd87c13ed526..1db454207d4ed53f10d264ff7c62669921aca329 100644 (file)
@@ -1341,7 +1341,12 @@ preprocessor_line (char *c)
            gfc_free (filename);
          return;
        }
+
       current_file = current_file->up;
+#ifdef USE_MAPPED_LOCATION
+      linemap_add (line_table, LC_RENAME, false, current_file->filename,
+                  current_file->line);
+#endif
     }
 
   /* The name of the file can be a temporary file produced by
@@ -1620,10 +1625,12 @@ gfc_new_file (void)
 
 #if 0 /* Debugging aid.  */
   for (; line_head; line_head = line_head->next)
-    gfc_status ("%s:%3d %s\n", line_head->file->filename, 
+    gfc_status ("%s:%3d %s\n",
 #ifdef USE_MAPPED_LOCATION
+               LOCATION_FILE (line_head->location),
                LOCATION_LINE (line_head->location),
 #else
+               line_head->file->filename, 
                line_head->linenum,
 #endif
                line_head->line);