Commit b8176fe4 by Eric Botcazou Committed by Eric Botcazou

final.c (force_source_line): New global variable.

	* 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
parent fcc207bf
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
......
......@@ -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);
}
/* 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment