diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2005-11-09 17:11:53 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2005-11-09 17:11:53 +0000 |
commit | b8176fe4bbaaf5e00f13aa6ce8003ff69ccd9380 (patch) | |
tree | 0dbdfec3f59de9aa56adb48641b686c8c5f602e5 /gcc/final.c | |
parent | fcc207bfd70c14e46f15a0d39db9ff3699afb87f (diff) | |
download | gcc-b8176fe4bbaaf5e00f13aa6ce8003ff69ccd9380.zip gcc-b8176fe4bbaaf5e00f13aa6ce8003ff69ccd9380.tar.gz gcc-b8176fe4bbaaf5e00f13aa6ce8003ff69ccd9380.tar.bz2 |
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
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/final.c b/gcc/final.c index ddd339b..ed1327d 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -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); |