diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-23 09:36:01 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-23 09:36:01 +0000 |
commit | 1b16fc454510309e7c6299c24890c40d2b2bc03c (patch) | |
tree | 1b72fa7fe409e2cd66cf065ec2671ab20dce7b57 /gcc/final.c | |
parent | d4cf8ff76d20953c1113f02bddfc22b61d7dd195 (diff) | |
download | gcc-1b16fc454510309e7c6299c24890c40d2b2bc03c.tar.gz |
* tree.h (block_nonartificial_location): New prototype.
* tree.c (block_nonartificial_location): New function.
* dwarf2out.c (gen_subprogram_die): Add DW_AT_artificial
if artificial attribute is present on abstract inline decl.
* c-common.c (handle_artificial_attribute): New function.
(c_common_attribute_table): Add artificial attribute.
* final.c (override_filename, override_linenum): New variables.
(final_scan_insn): For DBX_DEBUG or SDB_DEBUG, set override_filename
and override_linenum if inside of a block inlined from
__attribute__((__artificial__)) function.
(notice_source_line): Honor override_filename and override_linenum.
* doc/extend.texi: Document __attribute__((__artificial__)).
* config/i386/emmintrin.h: Add __artificial__ attribute to
all __always_inline__ functions.
* config/i386/mmintrin.h: Likewise.
* config/i386/tmmintrin.h: Likewise.
* config/i386/mm3dnow.h: Likewise.
* config/i386/pmmintrin.h: Likewise.
* config/i386/ammintrin.h: Likewise.
* config/i386/xmmintrin.h: Likewise.
* config/i386/smmintrin.h: Likewise.
* config/i386/bmmintrin.h: Likewise.
* config/i386/mmintrin-common.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128686 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/gcc/final.c b/gcc/final.c index 5187efa6256..8af31cc1955 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -137,6 +137,10 @@ static int high_function_linenum; /* Filename of last NOTE. */ static const char *last_filename; +/* Override filename and line number. */ +static const char *override_filename; +static int override_linenum; + /* Whether to force emission of a line note before the next insn. */ static bool force_source_line = false; @@ -1814,6 +1818,18 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* Mark this block as output. */ TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1; } + if (write_symbols == DBX_DEBUG + || write_symbols == SDB_DEBUG) + { + location_t *locus_ptr + = block_nonartificial_location (NOTE_BLOCK (insn)); + + if (locus_ptr != NULL) + { + override_filename = LOCATION_FILE (*locus_ptr); + override_linenum = LOCATION_LINE (*locus_ptr); + } + } break; case NOTE_INSN_BLOCK_END: @@ -1833,6 +1849,24 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, (*debug_hooks->end_block) (high_block_linenum, n); } + if (write_symbols == DBX_DEBUG + || write_symbols == SDB_DEBUG) + { + tree outer_block = BLOCK_SUPERCONTEXT (NOTE_BLOCK (insn)); + location_t *locus_ptr + = block_nonartificial_location (outer_block); + + if (locus_ptr != NULL) + { + override_filename = LOCATION_FILE (*locus_ptr); + override_linenum = LOCATION_LINE (*locus_ptr); + } + else + { + override_filename = NULL; + override_linenum = 0; + } + } break; case NOTE_INSN_DELETED_LABEL: @@ -2609,8 +2643,19 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, static bool notice_source_line (rtx insn) { - const char *filename = insn_file (insn); - int linenum = insn_line (insn); + const char *filename; + int linenum; + + if (override_filename) + { + filename = override_filename; + linenum = override_linenum; + } + else + { + filename = insn_file (insn); + linenum = insn_line (insn); + } if (filename && (force_source_line |