Commit 4ebcdc23 by Martin Liska Committed by Martin Liska

Remove .gcno file when compilation does not success (PR driver/56469).

2017-04-28  Martin Liska  <mliska@suse.cz>

	PR driver/56469
	* coverage.c (coverage_remove_note_file): New function.
	* coverage.h: Declare the function.
	* toplev.c (finalize): Clean if an error has been seen.

From-SVN: r247371
parent 34769baf
2017-04-28 Martin Liska <mliska@suse.cz> 2017-04-28 Martin Liska <mliska@suse.cz>
PR driver/56469
* coverage.c (coverage_remove_note_file): New function.
* coverage.h: Declare the function.
* toplev.c (finalize): Clean if an error has been seen.
2017-04-28 Martin Liska <mliska@suse.cz>
PR gcov-profile/80031 PR gcov-profile/80031
* gcov-dump.c (tag_blocks): Just print number of basic blocks. * gcov-dump.c (tag_blocks): Just print number of basic blocks.
* gcov-io.h (GCOV_TAG_BLOCKS_NUM): Remove unused macro. * gcov-io.h (GCOV_TAG_BLOCKS_NUM): Remove unused macro.
......
...@@ -731,6 +731,18 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum) ...@@ -731,6 +731,18 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
} }
} }
/* Remove coverage file if opened. */
void
coverage_remove_note_file (void)
{
if (bbg_file_name)
{
gcov_close ();
unlink (bbg_file_name);
}
}
/* Build a coverage variable of TYPE for function FN_DECL. If COUNTER /* Build a coverage variable of TYPE for function FN_DECL. If COUNTER
>= 0 it is a counter array, otherwise it is the function structure. */ >= 0 it is a counter array, otherwise it is the function structure. */
......
...@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
extern void coverage_init (const char *); extern void coverage_init (const char *);
extern void coverage_finish (void); extern void coverage_finish (void);
extern void coverage_remove_note_file (void);
/* Start outputting coverage information for the current /* Start outputting coverage information for the current
function. */ function. */
......
...@@ -1915,6 +1915,9 @@ finalize (bool no_backend) ...@@ -1915,6 +1915,9 @@ finalize (bool no_backend)
stack_usage_file = NULL; stack_usage_file = NULL;
} }
if (seen_error ())
coverage_remove_note_file ();
if (!no_backend) if (!no_backend)
{ {
statistics_fini (); statistics_fini ();
......
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