diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-09 19:09:06 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-09 19:09:06 +0000 |
commit | fb6e7e820874292570f2a21ddeeaf3c0d6b64f9a (patch) | |
tree | db23142fb6e185a73c16d2fd67d627629e6522ba /gcc/gcov.c | |
parent | cc987c956a21db05a1c20b7adf3ee1aa0f50b768 (diff) | |
download | gcc-fb6e7e820874292570f2a21ddeeaf3c0d6b64f9a.tar.gz |
* gcov.c (no_data_file): New flag.
(read_count_file): Set it if data file not present. Assume counts
zero if not found.
(output_lines): Don't name the data file, if there wasn't one.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116045 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/gcov.c b/gcc/gcov.c index d8cc9bd0927..3b249c7055b 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -277,6 +277,10 @@ static unsigned bbg_stamp; static char *da_file_name; +/* Data file is missing. */ + +static int no_data_file; + /* Output branch probabilities. */ static int flag_branches = 0; @@ -964,8 +968,10 @@ read_count_file (void) if (!gcov_open (da_file_name, 1)) { - fnotice (stderr, "%s:cannot open data file\n", da_file_name); - return 1; + fnotice (stderr, "%s:cannot open data file, assuming not executed\n", + da_file_name); + no_data_file = 1; + return 0; } if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC)) { @@ -1782,7 +1788,8 @@ output_lines (FILE *gcov_file, const source_t *src) fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name); fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name); - fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0, da_file_name); + fprintf (gcov_file, "%9s:%5d:Data:%s\n", "-", 0, + no_data_file ? "-" : da_file_name); fprintf (gcov_file, "%9s:%5d:Runs:%u\n", "-", 0, object_summary.ctrs[GCOV_COUNTER_ARCS].runs); fprintf (gcov_file, "%9s:%5d:Programs:%u\n", "-", 0, program_count); |