Commit bda815c5 by Martin Liska Committed by Martin Liska

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
parent d6092256
2018-09-24 Martin Liska <mliska@suse.cz> 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.
2018-09-24 Martin Liska <mliska@suse.cz>
* memory-block.h (memory_block_pool::release): Annotate with * memory-block.h (memory_block_pool::release): Annotate with
valgrind that the memory is not accessible. valgrind that the memory is not accessible.
......
...@@ -336,12 +336,13 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, ...@@ -336,12 +336,13 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum,
{ {
static int warned = 0; static int warned = 0;
bool warning_printed = false; bool warning_printed = false;
tree id = DECL_ASSEMBLER_NAME (current_function_decl);
warning_printed = warning_printed =
warning_at (input_location, OPT_Wcoverage_mismatch, warning_at (DECL_SOURCE_LOCATION (current_function_decl),
"the control flow of function %qE does not match " OPT_Wcoverage_mismatch,
"its profile data (counter %qs)", id, ctr_names[counter]); "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 ()) if (warning_printed && dump_enabled_p ())
{ {
dump_user_location_t loc dump_user_location_t loc
...@@ -370,10 +371,11 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum, ...@@ -370,10 +371,11 @@ get_coverage_counts (unsigned counter, unsigned cfg_checksum,
} }
else if (entry->lineno_checksum != lineno_checksum) else if (entry->lineno_checksum != lineno_checksum)
{ {
warning (OPT_Wcoverage_mismatch, warning_at (DECL_SOURCE_LOCATION (current_function_decl),
"source locations for function %qE have changed," OPT_Wcoverage_mismatch,
"source locations for function %qD have changed,"
" the profile data may be out of date", " the profile data may be out of date",
DECL_ASSEMBLER_NAME (current_function_decl)); current_function_decl);
} }
return entry->counts; return entry->counts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment