diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-02-18 17:11:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-18 17:11:40 +0100 |
commit | 497b7c47042d542ae48d10badf0c3d0088f6f798 (patch) | |
tree | 2b11d442aa53364fdd68052928947d8d48479c26 /gcc/final.c | |
parent | 0029b929c9719a9794492915206314308fbdf03a (diff) | |
download | gcc-497b7c47042d542ae48d10badf0c3d0088f6f798.zip gcc-497b7c47042d542ae48d10badf0c3d0088f6f798.tar.gz gcc-497b7c47042d542ae48d10badf0c3d0088f6f798.tar.bz2 |
final.c (last_columnnum, [...]): New variables.
* final.c (last_columnnum, override_columnnum): New variables.
(final_start_function): Set last_columnnum, pass it to begin_prologue
hook and pass 0 to dwarf2out_begin_prologue.
(final_scan_insn): Update override_columnnum. Pass last_columnnum
to source_line debug hook.
(notice_source_line): Compute last_columnnum and for debug_column_info
return true on column changes.
* debug.h (struct gcc_debug_hooks): Add column argument to
source_line and begin_prologue hooks.
(debug_nothing_int_charstar_int_bool): Remove prototype.
(debug_nothing_int_int_charstar,
debug_nothing_int_int_charstar_int_bool): New prototypes.
(dwarf2out_begin_prologue): Add column argument.
* debug.c (do_nothing_debug_hooks): Adjust source_line and
begin_prologue hooks.
(debug_nothing_int_charstar_int_bool): Remove.
(debug_nothing_int_int_charstar,
debug_nothing_int_int_charstar_int_bool): New functions.
* dwarf2out.c (dwarf2out_begin_prologue): Add column argument, pass it
through to dwarf2out_source_line.
(dwarf2_lineno_debug_hooks): Adjust begin_prologue hook.
(dwarf2out_source_line): Add column argument, emit it if requested.
* sdbout.c (sdbout_source_line, sdbout_begin_prologue): Add column
arguments.
* xcoffout.h (xcoffout_begin_prologue, xcoffout_source_line): Likewise.
* xcoffout.c (xcoffout_begin_prologue, xcoffout_source_line): Likewise.
* vmsdbgout.c (vmsdbgout_begin_prologue): Add column argument, pass it
through to dwarf2out_begin_prologue.
(vmsdbgout_source_line): Add column argument, pass it through to
dwarf2out_source_line.
* dbxout.c (dbxout_begin_prologue): Add column argument, adjust
dbxout_source_line caller.
(dbxout_source_line): Add column argument.
From-SVN: r245564
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/final.c b/gcc/final.c index 2483381..820162b 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -118,6 +118,9 @@ rtx_insn *current_output_insn; /* Line number of last NOTE. */ static int last_linenum; +/* Column number of last NOTE. */ +static int last_columnnum; + /* Last discriminator written to assembly. */ static int last_discriminator; @@ -133,9 +136,10 @@ static int high_function_linenum; /* Filename of last NOTE. */ static const char *last_filename; -/* Override filename and line number. */ +/* Override filename, line and column number. */ static const char *override_filename; static int override_linenum; +static int override_columnnum; /* Whether to force emission of a line note before the next insn. */ static bool force_source_line = false; @@ -1763,6 +1767,7 @@ final_start_function (rtx_insn *first, FILE *file, last_filename = LOCATION_FILE (prologue_location); last_linenum = LOCATION_LINE (prologue_location); + last_columnnum = LOCATION_COLUMN (prologue_location); last_discriminator = discriminator = 0; high_block_linenum = high_function_linenum = last_linenum; @@ -1771,10 +1776,10 @@ final_start_function (rtx_insn *first, FILE *file, asan_function_start (); if (!DECL_IGNORED_P (current_function_decl)) - debug_hooks->begin_prologue (last_linenum, last_filename); + debug_hooks->begin_prologue (last_linenum, last_columnnum, last_filename); if (!dwarf2_debug_info_emitted_p (current_function_decl)) - dwarf2out_begin_prologue (0, NULL); + dwarf2out_begin_prologue (0, 0, NULL); #ifdef LEAF_REG_REMAP if (crtl->uses_only_leaf_regs) @@ -2335,6 +2340,7 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, { override_filename = LOCATION_FILE (*locus_ptr); override_linenum = LOCATION_LINE (*locus_ptr); + override_columnnum = LOCATION_COLUMN (*locus_ptr); } } break; @@ -2370,11 +2376,13 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, { override_filename = LOCATION_FILE (*locus_ptr); override_linenum = LOCATION_LINE (*locus_ptr); + override_columnnum = LOCATION_COLUMN (*locus_ptr); } else { override_filename = NULL; override_linenum = 0; + override_columnnum = 0; } } break; @@ -2592,8 +2600,9 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, { if (flag_verbose_asm) asm_show_source (last_filename, last_linenum); - (*debug_hooks->source_line) (last_linenum, last_filename, - last_discriminator, is_stmt); + (*debug_hooks->source_line) (last_linenum, last_columnnum, + last_filename, last_discriminator, + is_stmt); } if (GET_CODE (body) == PARALLEL @@ -3078,23 +3087,26 @@ static bool notice_source_line (rtx_insn *insn, bool *is_stmt) { const char *filename; - int linenum; + int linenum, columnnum; if (override_filename) { filename = override_filename; linenum = override_linenum; + columnnum = override_columnnum; } else if (INSN_HAS_LOCATION (insn)) { expanded_location xloc = insn_location (insn); filename = xloc.file; linenum = xloc.line; + columnnum = xloc.column; } else { filename = NULL; linenum = 0; + columnnum = 0; } if (filename == NULL) @@ -3102,11 +3114,13 @@ notice_source_line (rtx_insn *insn, bool *is_stmt) if (force_source_line || filename != last_filename - || last_linenum != linenum) + || last_linenum != linenum + || (debug_column_info && last_columnnum != columnnum)) { force_source_line = false; last_filename = filename; last_linenum = linenum; + last_columnnum = columnnum; last_discriminator = discriminator; *is_stmt = true; high_block_linenum = MAX (last_linenum, high_block_linenum); |