final.c (force_source_line): New global variable.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 9 Nov 2005 17:11:53 +0000 (17:11 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 9 Nov 2005 17:11:53 +0000 (17:11 +0000)
* final.c (force_source_line): New global variable.
(final_scan_insn): Set it to true instead of clearing last_filename.
(notice_source_line): Return true if force_source_line is true,
unless source info is absent.

From-SVN: r106699

gcc/ChangeLog
gcc/final.c

index 48deb1779541d17e9be8343be72f6645dcb394ea..3e3c2d94d5e5ccfce32ad898b0ddb7b1553563d5 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-09  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * final.c (force_source_line): New global variable.
+       (final_scan_insn): Set it to true instead of clearing last_filename.
+       (notice_source_line): Return true if force_source_line is true,
+       unless source info is absent.
+
 2005-11-09  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR c/24644
index ddd339b3688065f7dbd2e09c29350b7677c35aeb..ed1327dc0a46173bdfaff442c509791bb276f852 100644 (file)
@@ -141,6 +141,9 @@ static int high_function_linenum;
 /* Filename of last NOTE.  */
 static const char *last_filename;
 
+/* Whether to force emission of a line note before the next insn.  */
+static bool force_source_line = false;
+  
 extern int length_unit_log; /* This is defined in insn-attrtab.c.  */
 
 /* Nonzero while outputting an `asm' with operands.
@@ -1739,7 +1742,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
          if ((*seen & (SEEN_EMITTED | SEEN_BB)) == SEEN_BB)
            {
              *seen |= SEEN_EMITTED;
-             last_filename = NULL;
+             force_source_line = true;
            }
          else
            *seen |= SEEN_BB;
@@ -1763,7 +1766,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
          if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
            {
              *seen |= SEEN_EMITTED;
-             last_filename = NULL;
+             force_source_line = true;
            }
          else
            *seen |= SEEN_NOTE;
@@ -1781,7 +1784,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
          if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
            {
              *seen |= SEEN_EMITTED;
-             last_filename = NULL;
+             force_source_line = true;
            }
          else
            *seen |= SEEN_NOTE;
@@ -2501,8 +2504,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
   return NEXT_INSN (insn);
 }
 \f
-/* Output debugging info to the assembler file FILE
-   based on the NOTE-insn INSN, assumed to be a line number.  */
+/* Return whether a source line note needs to be emitted before INSN.  */
 
 static bool
 notice_source_line (rtx insn)
@@ -2510,8 +2512,12 @@ notice_source_line (rtx insn)
   const char *filename = insn_file (insn);
   int linenum = insn_line (insn);
 
-  if (filename && (filename != last_filename || last_linenum != linenum))
+  if (filename
+      && (force_source_line
+         || filename != last_filename
+         || last_linenum != linenum))
     {
+      force_source_line = false;
       last_filename = filename;
       last_linenum = linenum;
       high_block_linenum = MAX (last_linenum, high_block_linenum);