diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-09 17:11:53 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-09 17:11:53 +0000 |
commit | e47ccf9458bc17dfcca55edc356c242271232dd7 (patch) | |
tree | 0dbdfec3f59de9aa56adb48641b686c8c5f602e5 /gcc/final.c | |
parent | 23bf35fe61ebc98ed68245fbb4635b7822d7cf19 (diff) | |
download | gcc-e47ccf9458bc17dfcca55edc356c242271232dd7.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106699 138bc75d-0d04-0410-961f-82ee72b054a4
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 ddd339b3688..ed1327dc0a4 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); |