diff options
author | Martin Liska <mliska@suse.cz> | 2018-09-24 13:28:23 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-09-24 11:28:23 +0000 |
commit | bda815c5972fa6a22967ce5a8acf4181cc320757 (patch) | |
tree | 4fe0fc2cc10ee8c9a752c05e268e594f8a149ff1 /gcc/coverage.c | |
parent | d609225669c3475adc236cd66968f99a3ca5aab5 (diff) | |
download | gcc-bda815c5972fa6a22967ce5a8acf4181cc320757.zip gcc-bda815c5972fa6a22967ce5a8acf4181cc320757.tar.gz gcc-bda815c5972fa6a22967ce5a8acf4181cc320757.tar.bz2 |
Improve location information of -Wcoverage-mismatch.
2018-09-24 Martin Liska <mliska@suse.cz>
* coverage.c (get_coverage_counts): Use warning_at
with current_function_decl location. Use %qD in warning
message.
From-SVN: r264530
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r-- | gcc/coverage.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c index 26cce2b..8f12778 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -336,12 +336,13 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, { static int warned = 0; bool warning_printed = false; - tree id = DECL_ASSEMBLER_NAME (current_function_decl); warning_printed = - warning_at (input_location, OPT_Wcoverage_mismatch, - "the control flow of function %qE does not match " - "its profile data (counter %qs)", id, ctr_names[counter]); + warning_at (DECL_SOURCE_LOCATION (current_function_decl), + OPT_Wcoverage_mismatch, + "the control flow of function %qD does not match " + "its profile data (counter %qs)", current_function_decl, + ctr_names[counter]); if (warning_printed && dump_enabled_p ()) { dump_user_location_t loc @@ -370,10 +371,11 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, } else if (entry->lineno_checksum != lineno_checksum) { - warning (OPT_Wcoverage_mismatch, - "source locations for function %qE have changed," - " the profile data may be out of date", - DECL_ASSEMBLER_NAME (current_function_decl)); + warning_at (DECL_SOURCE_LOCATION (current_function_decl), + OPT_Wcoverage_mismatch, + "source locations for function %qD have changed," + " the profile data may be out of date", + current_function_decl); } return entry->counts; |